:root {
    --login-primary: #006c6c;
    --login-primary-dark: #003f46;
    --login-gold: #d5a900;
    --login-nav-text: #203040;
    --login-ink: #1c2d3d;
    --login-muted: #667681;
    --login-border: #c9d7d6;
    --login-surface: rgba(255, 255, 255, 0.76);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--login-ink);
    background: #eef7f3;
    font-family: "Inter", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.account-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(22, 74, 77, 0.09);
    box-shadow: 0 3px 22px rgba(31, 70, 70, 0.06);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.account-nav-container {
    width: min(1540px, calc(100% - 48px));
    min-height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    gap: 36px;
    padding-block: 10px;
}

.account-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    text-decoration: none;
}

.account-brand img {
    width: 46px;
    height: 58px;
    object-fit: contain;
}

.account-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.account-brand-copy strong {
    color: var(--login-nav-text, #203040);
    font-size: 19px;
    letter-spacing: 0.02em;
}

.account-brand-copy small {
    margin-top: 5px;
    color: var(--login-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.account-nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 10px;
    gap: clamp(10px, 1.2vw, 24px);
    max-width: 100%;
    flex-basis: 100%;
}

.account-nav-links > a {
    position: relative;
    color: var(--login-nav-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.account-nav-links > a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
    height: 2px;
    background: var(--login-primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.account-nav-links > a:hover,
.account-nav-links > a:focus-visible {
    color: var(--login-primary);
}

.account-nav-links > a:hover::after,
.account-nav-links > a:focus-visible::after {
    transform: scaleX(1);
}

.account-language {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border: 1px solid #d7e3e1;
    border-radius: 999px;
    background: #f2f7f6;
}

.account-language a {
    min-width: 32px;
    padding: 4px 7px;
    border-radius: 999px;
    color: #687a7d;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.account-language a.active {
    color: #fff;
    background: var(--login-primary);
}

.account-menu-toggle {
    display: none;
    margin-left: auto;
    padding: 5px 8px;
    color: var(--login-primary-dark);
    border: 0;
    background: transparent;
    font-size: 30px;
    cursor: pointer;
}

.account-main {
    position: relative;
    min-height: 650px;
    padding: 64px 0 112px;
    overflow: hidden;
    background:
        linear-gradient(105deg, rgba(255, 255, 255, 0.98) 5%, rgba(250, 252, 248, 0.89) 48%, rgba(197, 225, 215, 0.72) 100%),
        #eef7f3;
}

.account-main::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='210' viewBox='0 0 240 210'%3E%3Cg fill='none' stroke='%237ab6a5' stroke-width='2'%3E%3Cpath d='M60 18l40 23v46l-40 23-40-23V41zM180 100l40 23v46l-40 23-40-23v-46z'/%3E%3Cpath d='M100 64h40M120 64v36M140 146h-40'/%3E%3Ccircle cx='120' cy='64' r='5' fill='%237ab6a5'/%3E%3Ccircle cx='140' cy='146' r='5' fill='%237ab6a5'/%3E%3C/g%3E%3C/svg%3E");
    background-position: calc(100% + 55px) 82px;
    background-repeat: no-repeat;
    background-size: 530px auto;
    pointer-events: none;
}

.account-molecule {
    position: absolute;
    border: 2px solid rgba(91, 153, 136, 0.13);
    transform: rotate(30deg);
    pointer-events: none;
}

.account-molecule::before,
.account-molecule::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(91, 153, 136, 0.14);
}

.account-molecule-one {
    right: 5%;
    top: 134px;
    width: 132px;
    height: 132px;
    border-radius: 38px;
}

.account-molecule-one::before {
    right: -7px;
    top: 54px;
}

.account-molecule-one::after {
    bottom: -7px;
    left: 55px;
}

.account-molecule-two {
    right: 15%;
    bottom: 92px;
    width: 82px;
    height: 82px;
    border-radius: 25px;
}

.account-container {
    position: relative;
    z-index: 2;
    width: min(1480px, calc(100% - 80px));
    margin: 0 auto;
}

.account-title {
    margin: 0 0 38px;
    color: var(--login-ink);
    font-size: clamp(34px, 3vw, 48px);
    font-weight: 400;
    letter-spacing: -0.035em;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(480px, 1fr);
    align-items: start;
    gap: 28px;
}

.account-note {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-height: 125px;
    padding: 25px 28px;
    border: 1px solid rgba(160, 151, 112, 0.35);
    border-radius: 8px;
    background: rgba(255, 250, 235, 0.68);
    box-shadow: 0 5px 20px rgba(83, 77, 52, 0.035);
}

.account-note-icon {
    padding-top: 2px;
    color: var(--login-gold);
    font-size: 22px;
}

.account-note h2 {
    display: inline-block;
    margin: 0 0 6px;
    color: #30343b;
    font-size: 17px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.account-note p {
    max-width: 650px;
    margin: 0;
    color: #48545c;
    font-size: 15px;
    line-height: 1.75;
}

.account-signup-wrap {
    padding: 22px 0 0;
    text-align: center;
}

.account-signup-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 11px 24px;
    color: #293137;
    border: 1px solid rgba(167, 129, 0, 0.25);
    border-radius: 7px;
    background: linear-gradient(180deg, #ebc31f 0%, var(--login-gold) 100%);
    box-shadow: 0 5px 12px rgba(184, 139, 0, 0.18);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.account-signup-button:hover,
.account-signup-button:focus-visible {
    color: #1e2529;
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(184, 139, 0, 0.24);
}

.signin-card {
    padding: 30px 42px 25px;
    border: 1px solid rgba(126, 157, 155, 0.42);
    border-radius: 8px;
    background: var(--login-surface);
    box-shadow: 0 10px 28px rgba(48, 86, 82, 0.12);
    backdrop-filter: blur(9px);
}

.signin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.signin-heading-icon {
    color: #17252d;
    font-size: 32px;
    line-height: 1;
}

.signin-heading h2 {
    margin: 0;
    color: var(--login-ink);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -0.025em;
}

.account-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 15px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 13px;
}

.account-alert-success {
    color: #246344;
    border-color: #b9dcc7;
    background: #edf9f1;
}

.account-alert-warning {
    color: #765a09;
    border-color: #ead99c;
    background: #fff9e8;
}

.account-alert-error {
    color: #8a2e3b;
    border-color: #e9bcc2;
    background: #fff1f3;
}

.signin-form {
    display: grid;
    gap: 16px;
}

.signin-field label {
    display: block;
    margin: 0 0 6px;
    color: #28353e;
    font-size: 14px;
    font-weight: 600;
}

.signin-field label span {
    margin-left: 2px;
    color: #b5223b;
}

.signin-input-wrap {
    position: relative;
}

.signin-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #778a8c;
    font-size: 15px;
    transform: translateY(-50%);
    pointer-events: none;
}

.signin-input-wrap input {
    width: 100%;
    height: 46px;
    padding: 10px 46px 10px 42px;
    color: #22343b;
    border: 1px solid #cad7d7;
    border-radius: 6px;
    outline: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 2px rgba(29, 65, 64, 0.03);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.signin-input-wrap input::placeholder {
    color: #a4afb1;
}

.signin-input-wrap input:focus {
    border-color: var(--login-primary);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-primary) 14%, transparent);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #6f8285;
    border: 0;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--login-primary);
    background: #edf5f3;
}

.signin-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    gap: 7px;
    min-height: 45px;
    margin-top: 2px;
    padding: 10px 20px;
    color: #fff;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--login-primary-dark), var(--login-primary));
    box-shadow: 0 5px 13px rgba(0, 78, 79, 0.2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.signin-submit:hover,
.signin-submit:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 7px 17px rgba(0, 78, 79, 0.27);
}

.signin-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid rgba(83, 112, 111, 0.34);
}

.signin-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.forgot-link {
    color: #8f2940;
}

.admin-link {
    color: #5a6c71;
}

.signin-links a:hover,
.signin-links a:focus-visible {
    color: var(--login-primary);
}

.account-footer {
    min-height: 240px;
    padding: 54px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 55% 20%, rgba(255, 255, 255, 0.35), transparent 35%),
        #dceee7;
}

.account-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 17px;
}

.account-footer-brand img {
    width: 74px;
    height: 92px;
    object-fit: contain;
}

.account-footer-brand strong {
    display: block;
    color: var(--login-nav-text, #203040);
    font-size: clamp(25px, 2.5vw, 37px);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.account-footer-brand strong span {
    color: var(--login-gold);
}

.account-footer-brand p {
    max-width: 460px;
    margin: 6px 0 0;
    color: #607772;
    font-size: 12px;
    line-height: 1.45;
}

.account-copyright {
    margin: 25px 0 0;
    color: #728984;
    font-size: 11px;
}

@media (max-width: 1280px) {
    .account-nav-container {
        width: min(1180px, calc(100% - 40px));
    }

    .account-nav-links {
        gap: 13px;
    }

    .account-nav-links > a {
        font-size: 11px;
    }

    .account-container {
        width: min(1140px, calc(100% - 64px));
    }
}

@media (max-width: 1040px) {
    .account-nav-container {
        min-height: 76px;
    }

    .account-menu-toggle {
        display: block;
    }

    .account-nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        margin: 0;
        padding: 15px 24px 20px;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid #e4ecea;
        box-shadow: 0 12px 25px rgba(29, 67, 65, 0.12);
    }

    .account-nav-links.is-open {
        display: flex;
    }

    .account-nav-links > a {
        padding: 11px 6px;
        border-bottom: 1px solid #edf2f1;
        font-size: 13px;
    }

    .account-nav-links > a::after {
        display: none;
    }

    .account-language {
        align-self: flex-start;
        margin-top: 14px;
    }

    .account-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .account-intro {
        max-width: none;
    }

    .signin-card {
        width: min(100%, 720px);
        justify-self: center;
    }
}

@media (max-width: 680px) {
    .account-nav-container {
        width: calc(100% - 28px);
    }

    .account-brand img {
        width: 38px;
        height: 49px;
    }

    .account-brand-copy strong {
        font-size: 16px;
    }

    .account-main {
        min-height: auto;
        padding: 40px 0 64px;
    }

    .account-main::before {
        background-size: 360px auto;
    }

    .account-container {
        width: calc(100% - 32px);
    }

    .account-title {
        margin-bottom: 26px;
        font-size: 34px;
    }

    .account-note {
        min-height: 0;
        padding: 20px;
    }

    .account-note p {
        font-size: 14px;
    }

    .signin-card {
        padding: 24px 20px 20px;
    }

    .signin-heading h2 {
        font-size: 26px;
    }

    .signin-links {
        align-items: flex-start;
        flex-direction: column;
        gap: 11px;
    }

    .account-footer {
        min-height: 220px;
        padding-top: 42px;
    }

    .account-footer-brand img {
        width: 54px;
        height: 70px;
    }

    .account-footer-brand p {
        max-width: 245px;
    }

    .account-copyright {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Email-verification notice after registering ==========================
   Rendered by views/auth/login.php only in the request right after a
   successful registration. It is visible from the first paint — no script
   opens it — because the sign-in page is the last place a new user should be
   left guessing why their password is refused. */

/* Its own palette on purpose. The page's --login-* variables are filled from
   the site theme, where --login-primary-dark is the NAV BACKGROUND — light on
   this site — which left the heading and the email address almost invisible.
   A notice that has to be read cannot depend on a colour an editor may
   lighten, so these are fixed, and each pairing is checked for contrast. */
:root {
    --verify-deep: #14314F;     /* headings and the button: 13.3:1 on white */
    --verify-mid: #23507E;      /* gradient partner, still 8.3:1 on white   */
    --verify-ink: #2B3440;      /* body text: 12.6:1 on white               */
    --verify-muted: #5A6675;    /* supporting lines: 6.0:1 on white         */
    --verify-tint: #EEF3F9;     /* panel fill                               */
    --verify-line: #C7D6E6;
    --verify-amber-bg: #FFF7E3;
    --verify-amber-edge: #C98A05;
    --verify-amber-ink: #5C4204; /* on the amber panel: 9.1:1               */
}

.verify-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(14, 26, 42, 0.58);
    backdrop-filter: blur(2px);
    overflow-y: auto;
    animation: verify-fade 0.22s ease-out;
}

.verify-dialog {
    width: 100%;
    max-width: 560px;
    margin: auto;
    border-radius: 14px;
    background: #fff;
    /* A hairline keeps the card defined even against a pale page. */
    border: 1px solid rgba(20, 49, 79, 0.14);
    box-shadow: 0 24px 60px rgba(12, 28, 48, 0.34);
    overflow: hidden;
    animation: verify-rise 0.26s ease-out;
}

.verify-dialog-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--verify-deep), var(--verify-mid));
    /* The university's gold, as a restrained rule rather than a block. */
    border-bottom: 3px solid #C9A227;
}

.verify-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 23px;
}

.verify-dialog-head h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .01em;
}

.verify-dialog-body {
    padding: 24px 26px 6px;
    color: var(--verify-ink);
    font-size: 15px;
    line-height: 1.85;
}

.verify-dialog-body p {
    margin: 0 0 13px;
}

.verify-dialog-email {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 15px;
    border: 1px solid var(--verify-line);
    border-radius: 8px;
    background: var(--verify-tint);
    color: var(--verify-deep);
    font-weight: 700;
    word-break: break-all;
}

.verify-dialog-email i {
    color: var(--verify-mid);
}

.verify-dialog-action {
    padding: 12px 15px;
    border-left: 4px solid var(--verify-amber-edge);
    border-radius: 0 8px 8px 0;
    background: var(--verify-amber-bg);
    color: var(--verify-amber-ink);
}

.verify-dialog-action strong {
    color: #452F02;
}

.verify-dialog-notes {
    margin: 0 0 14px;
    padding-left: 20px;
    color: var(--verify-muted);
    font-size: 14px;
}

.verify-dialog-notes li {
    margin-bottom: 7px;
}

.verify-dialog-notes li::marker {
    color: var(--verify-mid);
}

.verify-dialog-help {
    padding-top: 12px;
    border-top: 1px solid #E6EBF1;
    color: var(--verify-muted);
    font-size: 14px;
}

.verify-dialog-foot {
    padding: 4px 26px 24px;
    text-align: right;
}

.verify-dialog-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 30px;
    border: 0;
    border-radius: 8px;
    background: var(--verify-deep);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.verify-dialog-button:hover,
.verify-dialog-button:focus-visible {
    /* Darker on hover, not brighter: brightening a deep colour washed it out. */
    color: #fff;
    background: #0B2138;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(12, 28, 48, 0.28);
}

.verify-dialog-button:focus-visible {
    outline: 3px solid rgba(201, 162, 39, 0.65);
    outline-offset: 2px;
}

@keyframes verify-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes verify-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 575.98px) {
    .verify-dialog-head {
        padding: 18px 18px;
    }

    .verify-dialog-head h2 {
        font-size: 18px;
    }

    .verify-dialog-body {
        padding: 20px 18px 4px;
        font-size: 14px;
    }

    .verify-dialog-foot {
        padding: 4px 18px 20px;
        text-align: center;
    }

    .verify-dialog-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .verify-overlay,
    .verify-dialog {
        animation: none;
    }
}
