:root {
    --page-bg: #f0f4f9;
    --card-bg: #ffffff;
    --title: #1e1a4c;
    --text: #475569;
    --label: #000000;
    --field-bg: #f5f6f9;
    --placeholder: #7d91a1;
    --shadow: 0px 34px 44px -20px rgba(185, 206, 234, 0.25);
    --field-border: linear-gradient(164deg, rgba(226, 230, 255, 1) 24%, rgba(255, 234, 227, 1) 95%);
    --btn-gradient: linear-gradient(90deg, rgba(3, 161, 234, 1) 0%, rgba(32, 91, 175, 1) 100%);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
        "Microsoft YaHei", Arial, sans-serif;
    background-color: var(--page-bg);
    background-image: url("../competitio-assets/login-bg.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 51px;
    color: var(--text);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    width: 100%;
    max-width: 1111px;
    margin: 0 auto;
    padding: 133px 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 63px;
}

.illustration {
    width: 499px;
    height: 575px;
    object-fit: contain;
    margin-top: 114px;
    flex: 0 0 auto;
}

.card {
    width: 549px;
    max-width: 100%;
    background: var(--card-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    padding: 30px 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.title {
    margin: 0 !important;
    font-family: Nunito, Inter, system-ui, sans-serif;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    line-height: 1.364 !important;
    color: var(--title);
    text-align: center;
}

.info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-line {
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.2;
    color: #475569;
    /* white-space: pre-wrap; */
}

.info-label {
    color: #475569;
}

.info-value {
    color: #5380ea;
}

.competition-info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.competition-info-details p {
    margin: 0;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;

    color: #475569;


    /* Inside auto layout */
    flex: none;
    order: 1;
    flex-grow: 0;

}

.competition-info-details strong {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #475569;
    flex: none;
    order: 1;
    flex-grow: 0;
}

.competition-info-details span {
    width: 479px;
    height: 76px;

    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #175FF3;
    flex: none;
    order: 1;
    flex-grow: 0;
}

.form-v2 {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

label {

    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;

    color: #000000;
    /* Inside auto layout */
    flex: none;
    order: 0;
    flex-grow: 0;

}

.label-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.control {
    height: 48px;
    width: 100%;
    border-radius: 8px;
    border: 2px solid #5380ea;
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4fd 100%);
    padding: 0 12px;
    font-family: "PingFang SC", Inter, system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 48px;
    color: #1e1a4c;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(83, 128, 234, 0.15);
}

.control:focus {
    border-color: #03a1ea;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    box-shadow: 0 0 0 4px rgba(3, 161, 234, 0.2), 0 4px 12px rgba(83, 128, 234, 0.25);
    transform: translateY(-1px);
}

.control:hover {
    border-color: #03a1ea;
    box-shadow: 0 4px 12px rgba(83, 128, 234, 0.25);
}

.control::placeholder {
    color: var(--placeholder);
    opacity: 1;
}

.select-wrap {
    position: relative;
    width: 100%;
}

select.control {
    appearance: none;
    padding-right: 40px;
}

.select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    display: block;
}

/* Custom Select Styles (used by competition.js) */
.custom-select-container {
    position: relative;
    width: 100%;
    height: 48px;
    z-index: 10;
}

.custom-select-selected {
    height: 48px;
    width: 100%;
    border-radius: 8px;
    border: 2px solid #5380ea;
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4fd 100%);
    padding: 0 40px 0 12px;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    line-height: 48px;
    /* Adjust for border */
    color: #1e1a4c;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(83, 128, 234, 0.15);
    transition: all 0.2s ease;
}

.custom-select-selected:hover {
    border-color: #03a1ea;
    box-shadow: 0 4px 12px rgba(83, 128, 234, 0.25);
}

.custom-select-selected::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("../competitio-assets/chevron-down.svg");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    z-index: 100;
}

.custom-select-option {
    padding: 12px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-select-option:hover {
    background: #f1f5f9;
}

.custom-select-option.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #f8fafc;
}

.custom-select-option.selected {
    background: #e2eafc;
    color: #5380ea;
}

/* Tooltip for platform guide */
.platform-guide-tooltip {
    background: #1e1a4c;
    color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.5;
    z-index: 10001;
    max-width: 250px;
}

.platform-guide-close {
    position: absolute;
    right: 8px;
    top: 4px;
    cursor: pointer;
    font-size: 18px;
}

.platform-guide-tooltip::before {
    content: "";
    position: absolute;
    border: 8px solid transparent;
}

.platform-guide-tooltip:not(.position-bottom)::before {
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #1e1a4c;
}

.platform-guide-tooltip.position-bottom::before {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #1e1a4c;
}

.highlight-select {
    box-shadow: 0 0 0 3px rgba(3, 161, 234, 0.4);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0px rgba(3, 161, 234, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(3, 161, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(3, 161, 234, 0);
    }
}

.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.primary-btn {
    width: 180px;
    height: 48px;
    border-radius: 32px;
    border: 0;
    background: var(--btn-gradient);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    cursor: pointer;
}

.primary-btn-text {
    font-family: "Noto Sans SC", Inter, system-ui, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    color: #ffffff;
    pointer-events: none;
}

.primary-btn-icon {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

.register-link {
    font-weight: 500;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.register-link:hover {
    color: #03a1ea;
}

.meta-line {
    width: 100%;
    margin: 0;
    font-weight: 500;
    font-size: 16px !important;
    line-height: 1.2 !important;
    color: #475569 !important;
}

.meta-label {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: 16px !important;
    line-height: 19px 16px !important;
    color: #475569 16px !important;
    /* Inside auto layout */
    flex: none;
    order: 3;
    flex-grow: 0;

}

.meta-value {
    color: #5380ea;
    margin-left: 8px;
}

.meta-value--contest {
    color: #e54a2a;
}

footer {
    width: 100%;
    max-width: 1040px;
    margin: auto auto 0;
    padding: 0 24px 18px;
}

.footer-line {
    height: 1px;
    width: 100%;
    background: #cbd5e1;
    margin: 0 0 12px;
}

.footer-text {
    margin: 0;
    font-weight: 500;
    font-size: 12px !important;
    color: var(--text);
    text-align: center;
}

/* Modals */
.modal-v2-password {
    width: 450px;
    max-width: calc(100vw - 48px);
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0px 34px 44px -20px rgba(185, 206, 234, 0.25);
    padding: 32px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: auto;
    position: relative;
}

.modal-v2-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-v2-title {
    flex: 1;
    font-family: Nunito, system-ui, sans-serif;
    font-weight: 800;
    font-size: 2rem !important;
    text-align: center;
    color: #020F30;
}

.modal-v2-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-v2-close img {
    width: 24px;
    height: 24px;
}

.modal-v2-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Password Toggle Style */
.password-container {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #7d91a1;
    display: flex;
    align-items: center;
    z-index: 2;
}

/* Floating button */
.floating-back-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


/* Toast styles (Reverted to original UI) */
#toast-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    max-width: 350px;
    padding: 15px 20px;
    border-radius: 50px;
    color: #fff;
    font-family: Arial, sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 居中文本 */
    text-align: center;
    /* 居中文本 */
    pointer-events: auto;
    /* 允许 Toast 接收事件 */
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

.toast.info {
    background-color: #2196F3;
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (max-width: 900px) {
    .illustration {
        display: none;
    }

    .content {
        justify-content: center;
        padding-top: 60px;
    }
}