/* Behavior-only overrides for the validation prototype. */
[data-prototype-href] {
    cursor: pointer;
}

/* Password-recovery responsive safeguards. */
body[data-prototype-page="forgot-password"],
body[data-prototype-page="reset-password"],
body[data-prototype-page="reset-success"] {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body[data-prototype-page="forgot-password"] img,
body[data-prototype-page="reset-password"] img,
body[data-prototype-page="reset-success"] img {
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

body[data-prototype-page="forgot-password"] main,
body[data-prototype-page="reset-password"] main,
body[data-prototype-page="reset-success"] main,
body[data-prototype-page="forgot-password"] form,
body[data-prototype-page="reset-password"] form,
body[data-prototype-page="forgot-password"] input,
body[data-prototype-page="reset-password"] input {
    min-width: 0;
    max-width: 100%;
}

body[data-prototype-page="forgot-password"] footer,
body[data-prototype-page="reset-password"] footer,
body[data-prototype-page="reset-success"] footer {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 480px) {
    body[data-prototype-page="forgot-password"] > nav,
    body[data-prototype-page="reset-password"] > nav,
    body[data-prototype-page="reset-success"] > nav {
        min-height: 68px;
        gap: 10px;
        padding: 12px 14px;
    }

    body[data-prototype-page="forgot-password"] > nav img,
    body[data-prototype-page="reset-password"] > nav img,
    body[data-prototype-page="reset-success"] > nav img {
        max-height: 30px;
    }

    body[data-prototype-page="forgot-password"] main,
    body[data-prototype-page="reset-password"] main,
    body[data-prototype-page="reset-success"] main {
        width: 100%;
        padding: 32px 12px;
    }

    body[data-prototype-page="forgot-password"] main > div:not(.absolute),
    body[data-prototype-page="reset-password"] main > div:not(.absolute),
    body[data-prototype-page="reset-success"] main > div:not(.absolute) {
        width: 100%;
        max-width: 100%;
        padding-right: 18px;
        padding-left: 18px;
    }

    body[data-prototype-page="forgot-password"] footer > div,
    body[data-prototype-page="reset-password"] footer > div,
    body[data-prototype-page="reset-success"] footer > div {
        width: 100%;
        padding: 26px 14px;
    }

    body[data-prototype-page="forgot-password"] footer .flex,
    body[data-prototype-page="reset-password"] footer .flex,
    body[data-prototype-page="reset-success"] footer .flex {
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

body[data-prototype-page="login"] #login-error {
    display: none;
}

body[data-prototype-page="login"] #login-error.is-visible {
    display: flex;
}

@media (max-width: 820px) {
    body[data-prototype-page="login"] footer > div > div {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    body[data-prototype-page="login"] footer p {
        width: 100%;
    }
}

body[data-prototype-page="create-account"],
body[data-prototype-page="login"] {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body[data-prototype-page="create-account"] img,
body[data-prototype-page="login"] img {
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

body[data-prototype-page="create-account"] nav,
body[data-prototype-page="login"] > header {
    min-width: 0;
    gap: 12px;
}

body[data-prototype-page="create-account"] main,
body[data-prototype-page="login"] main {
    width: 100%;
    min-width: 0;
}

body[data-prototype-page="create-account"] main > div,
body[data-prototype-page="login"] main > div:not(.absolute) {
    width: 100%;
    min-width: 0;
    max-width: min(100%, 540px);
}

body[data-prototype-page="login"] main > div:not(.absolute) {
    max-width: min(100%, 440px);
}

body[data-prototype-page="create-account"] input,
body[data-prototype-page="login"] input,
body[data-prototype-page="create-account"] button,
body[data-prototype-page="login"] button {
    min-width: 0;
    max-width: 100%;
}

body[data-prototype-page="create-account"] footer,
body[data-prototype-page="login"] footer {
    width: 100%;
    max-width: 100%;
}

.auth-mobile-footer { display: none; }

/* Shared Auth form feedback and submission states. */
body[data-prototype-page="login"] form input:not([type="checkbox"]),
body[data-prototype-page="create-account"] form input:not([type="checkbox"]),
body[data-prototype-page="forgot-password"] form input:not([type="checkbox"]),
body[data-prototype-page="reset-password"] form input:not([type="checkbox"]) {
    height: 52px;
}

body[data-prototype-page="login"] form button[type="submit"],
body[data-prototype-page="create-account"] form button[type="submit"],
body[data-prototype-page="create-account"] form button:not([type]),
body[data-prototype-page="forgot-password"] form button[type="submit"],
body[data-prototype-page="reset-password"] form button[type="submit"] {
    height: 56px;
    min-height: 56px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    white-space: nowrap;
}

body[data-prototype-page="reset-success"] main button {
    height: 56px;
    min-height: 56px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    white-space: nowrap;
}

body[data-prototype-page] form input[aria-invalid="true"] {
    border-color: #c7352d !important;
    box-shadow: 0 0 0 2px rgba(199, 53, 45, 0.1);
}

.auth-field-error {
    width: 100%;
    margin: 6px 0 0;
    color: #b42318;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    text-align: right;
}

.auth-submit-loading {
    cursor: wait;
    opacity: 0.78;
}

body[data-prototype-page="forgot-password"] #confirmation {
    width: 100%;
    line-height: 1.7;
}

body[data-prototype-page="forgot-password"] #confirmation > div {
    min-width: 0;
}

.auth-demo-continue {
    display: inline-flex;
    margin-top: 8px;
    color: #00647c;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Keep the auth-shell wordmark at its intended compact size. The general
   responsive image safeguard above must not override Tailwind's h-8 class. */
body[data-prototype-page="create-account"] > nav img,
body[data-prototype-page="login"] > header img,
body[data-prototype-page="create-account"] > footer img,
body[data-prototype-page="login"] > footer img {
    display: block;
    width: auto;
    height: 32px;
    max-width: 150px;
    object-fit: contain;
    object-position: center;
}

/* Use one consistent, accessible brand color for the return-home action. */
body[data-prototype-page="create-account"] > nav > a[href="../index.html"],
body[data-prototype-page="login"] > header > a[href="../index.html"] {
    color: #00647c;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

body[data-prototype-page="create-account"] footer a,
body[data-prototype-page="login"] footer a,
body[data-prototype-page="login"] #login-error p {
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    body[data-prototype-page="create-account"] nav,
    body[data-prototype-page="login"] > header {
        min-height: 68px;
        height: auto;
        padding: 12px 14px;
    }

    body[data-prototype-page="create-account"] nav img,
    body[data-prototype-page="login"] > header img {
        height: 30px;
        max-height: 30px;
        max-width: 140px;
    }

    body[data-prototype-page="create-account"] > footer img,
    body[data-prototype-page="login"] > footer img {
        height: 30px;
        max-width: 140px;
    }

    body[data-prototype-page="create-account"] nav a,
    body[data-prototype-page="login"] > header a {
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
        white-space: normal;
    }

    body[data-prototype-page="create-account"] main {
        padding: 104px 12px 32px;
    }

    body[data-prototype-page="login"] main {
        padding: 32px 12px;
        overflow-x: clip;
        overflow-y: visible;
    }

    body[data-prototype-page="create-account"] .glass-card,
    body[data-prototype-page="login"] .glass-card {
        width: 100%;
        max-width: 100%;
        padding: 18px;
    }

    body[data-prototype-page="create-account"] footer > div,
    body[data-prototype-page="login"] footer > div {
        width: 100%;
        padding: 28px 14px;
    }

    body[data-prototype-page="create-account"] footer .flex-wrap,
    body[data-prototype-page="login"] footer .flex {
        max-width: 100%;
    }

    body[data-prototype-page="login"] #login-error {
        align-items: flex-start;
    }

    body[data-prototype-page] footer:has(> .auth-mobile-footer) > :not(.auth-mobile-footer) {
        display: none !important;
    }

    body[data-prototype-page] footer > .auth-mobile-footer {
        display: flex !important;
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 14px 10px !important;
    }

    .auth-mobile-footer__links {
        display: flex;
        width: 100%;
        max-width: 100%;
        flex-flow: row nowrap;
        align-items: center;
        justify-content: center;
        gap: clamp(10px, 3.5vw, 16px);
    }

    .auth-mobile-footer__links a {
        min-width: 0;
        color: #52676f;
        font-size: 11px;
        line-height: 1.4;
        overflow-wrap: normal;
        white-space: nowrap;
    }

    .auth-mobile-footer p {
        width: 100%;
        margin: 0;
        color: #60747d;
        font-size: 10.5px;
        line-height: 1.4;
        text-align: center;
        white-space: nowrap;
    }
}

/* Canonical Auth shell: Login is the visual reference for all Auth states. */
:is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7fafc;
    color: #173842;
}

html:has(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) {
    scrollbar-gutter: stable;
}

@media (max-width: 767px) {
    html:has(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) {
        scrollbar-gutter: auto;
    }
}

.auth-shell-header {
    position: relative !important;
    inset: auto !important;
    z-index: 20;
    width: 100%;
    height: 72px !important;
    min-height: 72px !important;
    padding: 0 clamp(16px, 4vw, 48px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid #e2eaed !important;
    box-shadow: none !important;
}

.auth-shell-header .auth-logo-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 !important;
}

.auth-shell-header .auth-logo-link img {
    display: block;
    width: auto !important;
    height: 32px !important;
    max-width: 150px !important;
    max-height: 32px !important;
    object-fit: contain;
}

.auth-shell-header .auth-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 0 !important;
    color: #00647c !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    text-decoration: none;
    white-space: nowrap !important;
}

.auth-shell-header .auth-home-link:hover {
    color: #004d61 !important;
}

.auth-shell-header .auth-home-link .material-symbols-outlined {
    font-size: 21px !important;
    line-height: 1;
}

/* Shared Auth hierarchy: page heading first, form surface second. */
.auth-page-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-page-heading {
    width: 100%;
    margin: 0 !important;
    text-align: center;
}

.auth-page-heading h1,
.auth-state-title {
    margin: 0 0 8px !important;
    color: #183a48 !important;
    font-family: Cairo, sans-serif !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.auth-page-heading p {
    max-width: 420px;
    margin: 0 auto !important;
    color: #3e484d !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
}

.auth-page-heading__icon {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 14px !important;
}

.auth-form-card {
    width: 100%;
}

:is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) main {
    width: 100%;
    flex: 1 0 auto;
    padding: 40px 16px !important;
    background: #f7fafc;
}

:is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) main > div:not(.absolute) {
    width: 100% !important;
    max-width: 440px !important;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
}

:is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) .glass-card {
    border: 1px solid rgba(190, 208, 214, 0.7) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 12px 36px rgba(4, 47, 71, 0.08) !important;
}

:is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) footer {
    width: 100%;
    margin-top: auto;
    background: #f3f7f8 !important;
    border-top: 1px solid #dce6e9 !important;
}

body[data-prototype-page] footer:has(> .auth-mobile-footer) > :not(.auth-mobile-footer) {
    display: none !important;
}

body[data-prototype-page] footer > .auth-mobile-footer {
    display: flex !important;
    width: 100%;
    max-width: 100%;
    min-height: 76px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px !important;
}

.auth-mobile-footer__links {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 3vw, 28px);
}

.auth-mobile-footer__links a {
    min-width: 0;
    color: #52676f;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    overflow-wrap: normal;
    white-space: nowrap;
}

.auth-mobile-footer__links a:hover {
    color: #00647c;
    text-decoration: underline;
}

.auth-mobile-footer p {
    width: 100%;
    margin: 0;
    color: #60747d;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .auth-page-stack {
        gap: 18px;
    }

    .auth-page-heading h1,
    .auth-state-title {
        margin-bottom: 6px !important;
        font-size: 26px !important;
        line-height: 1.45 !important;
    }

    .auth-page-heading p {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    .auth-page-heading__icon {
        width: 52px !important;
        height: 52px !important;
        margin-bottom: 12px !important;
    }

    .auth-shell-header {
        height: 68px !important;
        min-height: 68px !important;
        padding: 0 14px !important;
        gap: 10px !important;
    }

    .auth-shell-header .auth-logo-link img {
        height: 30px !important;
        max-height: 30px !important;
        max-width: 138px !important;
    }

    .auth-shell-header .auth-home-link {
        gap: 6px;
        font-size: 13px !important;
    }

    :is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) main {
        padding: 28px 12px !important;
    }

    :is(body[data-prototype-page="login"], body[data-prototype-page="create-account"], body[data-prototype-page="forgot-password"], body[data-prototype-page="reset-password"], body[data-prototype-page="reset-success"]) main > div:not(.absolute) {
        max-width: 100% !important;
    }

    .auth-mobile-footer__links {
        gap: clamp(10px, 3.5vw, 16px);
    }

    .auth-mobile-footer__links a {
        font-size: 11px;
    }

    .auth-mobile-footer p {
        font-size: 10.5px;
    }
}
