:root {
    --brand-900: #123d2a;
    --brand-800: #185237;
    --brand-700: #0d3526;
    --brand-600: #0d3526;
    --brand-500: #0d3526;
    --brand-100: #eef1ef;
    --brand-50: #f6f8f7;
    --ink-900: #132018;
    --ink-700: #405148;
    --ink-500: #6b7a72;
    --line: #dce8e1;
    --surface: #ffffff;
    --surface-soft: rgba(18, 61, 42, .34);
    --danger: #d92d20;
    --success: #0d3526;
    --shadow-sm: 0 8px 24px rgba(18, 61, 42, .08);
    --shadow-lg: 0 24px 70px rgba(18, 61, 42, .22);
    --radius: 8px;
    --speed: .24s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

html {
    background: var(--brand-900);
}

body {
    min-height: 100vh;
    font-size: 14px;
    color: #fff;
    background-color: var(--brand-900);
    background-image:
        linear-gradient(135deg, rgba(18, 61, 42, .38), rgba(47, 158, 98, .20)),
        url("../Acadsync.jpg");
    background-position: center, center;
    background-size: cover, cover;
    background-repeat: no-repeat;
    background-attachment: scroll, fixed;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 112px 20px 40px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

.wrapper::before {
    content: "AcadSync";
    position: fixed;
    left: clamp(20px, 5vw, 72px);
    top: 92px;
    font-size: clamp(3.5rem, 12vw, 9rem);
    line-height: 1;
    font-weight: 800;
    color: rgba(255, 255, 255, .08);
    pointer-events: none;
}

.nav {
    position: fixed;
    inset: 0 0 auto;
    height: 78px;
    padding: 0 clamp(18px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(220, 232, 225, .9);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    animation: login-nav-enter .5s .04s ease-out both;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--brand-800);
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--speed);
}

.nav-brand:hover,
.nav-brand:focus-visible {
    color: var(--brand-600);
    outline: none;
}

.landing-main {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 540px);
    justify-content: center;
    align-items: center;
    animation: login-form-enter .62s .1s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes login-nav-enter {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@keyframes login-form-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
}
.form-box {
    position: relative;
    width: 100%;
    max-width: 540px;
    min-height: 360px;
    overflow: hidden;
    padding: 34px 0;
    background: var(--surface-soft);
    border: 1px solid rgba(255, 255, 255, .30);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.form-box.register-active {
    min-height: 680px;
}

/* Keep the login help links visible when a multi-line sign-in message appears. */
.form-box:has(.login-container #login-error[style*="block"]) {
    min-height: 440px;
}

.form-box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-700), var(--brand-500));
}


.video-stories-head {
    margin-bottom: 16px;
    color: var(--ink-900);
}

.video-stories-head span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--brand-800);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.video-stories-head h2 {
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.15;
}

.video-stories-head p {
    margin-top: 8px;
    color: var(--ink-700);
    line-height: 1.55;
}

.video-stories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.video-story-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(18, 61, 42, .08);
}

.video-story-card video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 320px;
    object-fit: cover;
    background: #10251b;
}

.video-story-card span {
    display: block;
    padding: 10px 12px;
    color: var(--ink-900);
    font-size: .82rem;
    font-weight: 800;
}

.login-container,
.register-container {
    position: absolute;
    top: 34px;
    width: calc(100% - 8px);
    padding: 0 26px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    transition: .45s ease-in-out;
}

.login-container.is-active,
.register-container.is-active {
    pointer-events: auto;
}

.login-container {
    left: 4px;
}

.register-container {
    top: 14px;
    right: -640px;
}
.top span {
    color: rgba(255, 255, 255, .90);
    font-size: .9rem;
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 8px 0;
}

.top span a,
.two a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.top span a:hover,
.two a:hover {
    color: var(--brand-100);
    text-decoration: underline;
}

header {
    color: #fff;
    font-size: 1.72rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 26px;
}

.two-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.input-box {
    position: relative;
    margin-bottom: 15px;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: var(--radius);
    outline: none;
    color: var(--ink-900);
    background: rgba(255, 255, 255, .84);
    transition: var(--speed);
}

.input-field::placeholder {
    color: #7f8f86;
}

.input-field:hover,
.input-field:focus {
    border-color: var(--brand-500);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 0 0 4px rgba(47, 158, 98, .14);
}

.input-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-600);
    font-size: 1.1rem;
}

.input-box:has(.password-toggle) .input-field {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--brand-700);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--speed);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(47, 158, 98, .12);
    outline: none;
}

.password-toggle i {
    position: static;
    transform: none;
    color: currentColor;
    font-size: 1.2rem;
}

.password-rule-hint {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: -5px 2px 15px;
    color: rgba(255, 255, 255, .9);
    font-size: .76rem;
    line-height: 1.45;
}

.password-rule-hint i {
    margin-top: 1px;
    color: #bfeccd;
    font-size: 1rem;
}

.submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
    color: #fff;
    font-size: .98rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--speed);
    box-shadow: 0 14px 30px rgba(31, 111, 73, .22);
    touch-action: manipulation;
}

.submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(31, 111, 73, .28);
}

.submit:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(.12);
}

.submit:disabled:hover {
    transform: none;
    box-shadow: none;
}

.two-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .92);
    font-size: .86rem;
    margin-top: 12px;
}

.two-col .one {
    display: flex;
    align-items: center;
    gap: 8px;
}

.two-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-700);
}

.login-help-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: .9rem;
}

.login-help-row.is-hidden {
    display: none;
}

.login-switch-text {
    color: rgba(255, 255, 255, .9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 200;
    text-align: center;
}

.login-switch-text a {
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.login-help-row > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: var(--speed);
}

.login-help-row > a:hover,
.login-help-row > a:focus-visible {
    color: var(--brand-100);
    background: rgba(255, 255, 255, .1);
    outline: none;
}

.login-helper-note {
    color: rgba(255, 255, 255, .86);
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
}

#adminLoginLink,
.login-mode-button {
    width: 100%;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 10px 24px rgba(18, 61, 42, .12);
    transition: var(--speed);
}

#adminLoginLink:hover,
#adminLoginLink:focus-visible,
#studentLoginLink:hover,
#studentLoginLink:focus-visible {
    color: var(--brand-900);
    background: #fff;
}

.form-message {
    margin: -6px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.35;
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

.message-error {
    color: #7a1010;
    background: #fff0f0;
    border-color: #f2b7b7;
}

.message-success {
    color: #145c2d;
    background: #ecfff4;
    border-color: #0d3526;
}

.message-warning {
    color: #684400;
    background: #fff7db;
    border-color: #ead07b;
}

.message-info {
    color: var(--brand-900);
    background: #edf8f1;
    border-color: #a9d7ba;
}

.select-box select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.select-box select.input-field option {
    color: var(--ink-900);
    background: #fff;
}

.select-box::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 20px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--brand-600);
    border-bottom: 2px solid var(--brand-600);
    transform: rotate(45deg);
    pointer-events: none;
}

.privacy-consent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 14px;
    padding: 12px;
    border: 1px solid rgba(232, 246, 238, .88);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 10px 24px rgba(18, 61, 42, .12);
}

.privacy-copy {
    min-width: 0;
}

.privacy-copy strong {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-900);
    font-size: .84rem;
    line-height: 1.25;
}

.privacy-copy strong i {
    color: var(--brand-700);
    font-size: 1rem;
}

.privacy-copy span {
    display: block;
    margin-top: 3px;
    color: var(--ink-700);
    font-size: .76rem;
    line-height: 1.35;
}

.privacy-consent.accepted {
    border-color: #0d3526;
    background: #ecfff4;
}

.privacy-consent.accepted .privacy-copy strong,
.privacy-consent.accepted .privacy-copy span {
    color: #145c2d;
}

.privacy-accepted-badge {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--success);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 18px rgba(22, 131, 61, .22);
}

.privacy-accepted-badge.hidden {
    display: none;
}

.privacy-read-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--brand-700);
    border-radius: 8px;
    background: var(--brand-700);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--speed);
}

.privacy-read-btn:hover,
.privacy-read-btn:focus-visible {
    background: var(--brand-800);
    outline: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(19, 32, 24, .58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    width: min(100%, 420px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink-900);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-head span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-head i {
    color: var(--ink-500);
    font-size: 1.3rem;
    transition: var(--speed);
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
    background: var(--brand-100);
    outline: none;
}

.modal-head i:hover {
    color: var(--brand-700);
}

.forgot-flow-box {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.privacy-flow-box {
    width: min(100%, 500px);
    max-height: min(720px, calc(100dvh - 48px));
    padding: 22px;
    overflow-y: auto;
}

.privacy-flow-box .modal-head {
    font-size: 1.08rem;
    margin-bottom: 8px;
}

.privacy-flow-box .modal-sub {
    margin-bottom: 12px;
    font-size: .84rem;
}

.privacy-flow-box .submit {
    height: 46px;
    font-size: .9rem;
}

.privacy-notice-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.privacy-notice-list div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--brand-50);
}

.privacy-notice-list strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-900);
}

.privacy-notice-list span {
    color: var(--ink-700);
    font-size: .82rem;
    line-height: 1.4;
}

.privacy-modal-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink-900);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.45;
}

.privacy-modal-agree input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: 0 0 auto;
    accent-color: var(--brand-700);
}

.privacy-modal-actions {
    margin-top: 12px;
}

.privacy-modal-actions .submit:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-submit {
    background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

.modal-sub {
    color: var(--ink-500);
    font-size: .9rem;
    margin-bottom: 18px;
}

@media (max-width: 640px) {
    .wrapper {
        padding: 96px 14px 28px;
    }

    .nav {
        height: 68px;
        padding: 0 14px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .landing-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-box {
        min-height: 430px;
        padding: 28px 0;
    }

    .form-box.register-active {
        min-height: 760px;
    }

    .form-box:has(.login-container #login-error[style*="block"]) {
        min-height: 500px;
    }

    .login-container,
    .register-container {
        top: 30px;
        width: calc(100% - 8px);
        padding: 0 14px;
    }

    .login-container {
        left: 4px;
    }

    .register-container {
        top: 12px;
    }

    .two-forms {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .privacy-consent {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .privacy-read-btn {
        width: 100%;
    }

    header {
        font-size: 1.72rem;
    }

    .form-box,
    .form-box.register-active {
        min-height: auto !important;
        overflow: visible;
        padding: 18px 0;
    }

    .login-container,
    .register-container {
        position: relative;
        top: auto;
        right: auto !important;
        left: auto !important;
        width: 100%;
        padding: 0 16px;
        display: none;
        transform: none !important;
    }

    .login-container.is-active,
    .register-container.is-active {
        display: flex;
    }

    .password-rule-hint {
        margin-bottom: 14px;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .wrapper {
        padding: 104px 24px 36px;
    }

    .landing-main,
    .form-box {
        max-width: 560px;
    }
}

@media (max-width: 820px), (pointer: coarse) {
    body {
        background-attachment: scroll, scroll;
    }

    .wrapper::before {
        position: absolute;
    }

    .nav,
    .form-box {
        backdrop-filter: none;
    }
}

@media (max-height: 700px) and (min-width: 641px) {
    .wrapper {
        align-items: flex-start;
        padding-top: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav,
    .landing-main {
        animation: none;
    }
}
