/* ==========================================================================
   Public account pages (login, forgot / reset password, registration request).
   Based on the GFOC_Frontend reference design. Used only by _AuthLayout.cshtml.
   ========================================================================== */

:root {
    color-scheme: light;
    --blue: #293183;
    --blue-dark: #20266b;
    --ink: #31343b;
    --muted: #626874;
    --line: #dce0e5;
    --focus: #63b2dc;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font: 15px/1.6 Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    min-height: 100vh;
    border-top: 3px solid var(--blue);
    display: flex;
    flex-direction: column;
}

/* Bootstrap (loaded by _AuthLayout like the portal layout) removes link underlines — restore them */
.auth-body a:not(.primary-button) {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-body a:not(.primary-button):hover {
    color: var(--blue);
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.auth-main {
    width: min(100% - 48px, 420px);
    /* auto top/bottom: centered between the top border and the footer when there is room */
    margin: auto;
    padding: 28px 0 20px;
}

.auth-main.auth-wide {
    width: min(100% - 48px, 620px);
    padding-top: 24px;
}

.brand {
    display: block;
    width: min(100%, 280px);
    margin: 0 auto 16px;
}

.auth-wide .brand {
    width: min(100%, 260px);
    margin-bottom: 14px;
}

.brand img {
    display: block;
    width: 100%;
    height: auto;
}

.portal-label {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #646975;
    font-size: 11px;
    margin: 0 0 22px;
}

.auth-wide .portal-label {
    margin-bottom: 20px;
}

.portal-label:before,
.portal-label:after {
    content: "";
    height: 1px;
    background: var(--line);
    flex: 1;
}

h1 {
    color: var(--blue);
    font-size: 26px;
    line-height: 1.3;
    font-weight: 400;
    margin: 0 0 12px;
}

.intro {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 20px;
    line-height: 1.6;
}

.auth-wide .intro {
    margin-bottom: 20px;
}

/* ---------- Form ---------------------------------------------------------- */

.field {
    margin: 0 0 16px;
    min-width: 0;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 7px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid #bfc5ce;
    border-radius: 2px;
    background: #fff;
    padding: 9px 12px;
    font: 16px Arial, Helvetica, sans-serif;
    color: var(--ink);
}

input:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

input::placeholder {
    color: #777e89;
    font-size: 14px;
}

input.input-validation-error {
    border-color: var(--danger);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    right: 2px;
    top: 2px;
    min-width: 54px;
    min-height: 40px;
    background: #fff;
    color: var(--blue);
    border: 0;
    cursor: pointer;
    font-size: 12px;
}

.password-toggle:hover {
    background: #f1f4f7;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.forgot-row {
    text-align: right;
    margin: -4px 0 18px;
    font-size: 13px;
}

.primary-button {
    display: block;
    width: 100%;
    min-height: 46px;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    border-radius: 2px;
    font: 600 14px Arial, Helvetica, sans-serif;
    padding: 13px 18px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.primary-button:hover {
    background: var(--blue-dark);
    color: #fff;
}

.field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
}

.required-note {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 16px;
}

/* ---------- Validation (ASP.NET tag helpers) ------------------------------ */

.field-validation-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--danger);
}

.field-validation-valid {
    display: none;
}

.validation-summary-errors {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 3px solid var(--danger);
    background: #fdf2f1;
    color: var(--danger);
    font-size: 13px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.validation-summary-valid {
    display: none;
}

/* ---------- Secondary blocks ---------------------------------------------- */

.account-link {
    border-top: 1px solid var(--line);
    margin: 20px 0 0;
    padding-top: 14px;
    font-size: 13px;
    text-align: center;
}

.account-link p {
    margin: 0 0 5px;
    color: var(--muted);
}

.account-link a {
    display: inline-block;
    padding: 2px 0;
}

.apps {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.apps p {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px;
}

.stores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stores a {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.stores img {
    display: block;
    width: 112px;
    height: auto;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    font-size: 13px;
    padding: 8px 0;
}

.form-message {
    font-size: 13px;
    background: #f1f5f8;
    border-left: 3px solid #62b1db;
    padding: 14px;
    margin: 0 0 20px;
}

.form-message--error {
    background: #fdf2f1;
    border-left-color: var(--danger);
    color: var(--danger);
}

/* ---------- Cookie consent (_CookieConsentPartial) ------------------------ */

/* id selector so it wins over Bootstrap's .alert / .alert-info / .alert-dismissible */
#cookieConsent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0 0 24px;
    padding: 12px 14px;
    background: #f1f5f8;
    color: var(--ink);
    border: 0;
    border-left: 3px solid #62b1db;
    border-radius: 0;
    font-size: 13px;
}

#cookieConsent .navbar-brand {
    font-size: inherit;
    padding: 0;
    margin: 0;
}

#cookieConsent .accept-policy {
    position: static;
    float: none;
    flex-shrink: 0;
    margin-left: auto;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--blue);
    border-radius: 2px;
    background: var(--blue);
    color: #fff;
    font: 600 12px Arial, Helvetica, sans-serif;
    cursor: pointer;
    opacity: 1;
    text-shadow: none;
}

/* ---------- Footer -------------------------------------------------------- */

.auth-footer {
    width: 100%;
    margin: 0;
    padding: 15px 24px;
    text-align: center;
    font-size: 13px;
    color: #20265f;
    background: #008cd8;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    padding: 10px;
    background: #fff;
}

.skip-link:focus {
    top: 8px;
}

/* short screens (laptops): keep the login form on one screen without scrolling */
@media (min-width: 521px) and (max-height: 900px) {
    .auth-main,
    .auth-main.auth-wide {
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .brand,
    .auth-wide .brand {
        width: min(100%, 215px);
        margin-bottom: 10px;
    }

    .portal-label,
    .auth-wide .portal-label {
        margin-bottom: 14px;
    }

    h1 {
        font-size: 23px;
        margin-bottom: 6px;
    }

    .intro {
        margin-bottom: 14px;
    }

    .field {
        margin-bottom: 12px;
    }

    label {
        margin-bottom: 5px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"] {
        min-height: 40px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .password-toggle {
        min-height: 36px;
    }

    .forgot-row {
        margin-bottom: 14px;
    }

    .primary-button {
        min-height: 42px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .account-link {
        margin-top: 14px;
        padding-top: 10px;
    }

    .apps {
        margin-top: 12px;
        padding-top: 10px;
    }

    .stores img {
        width: 100px;
    }

    #cookieConsent {
        margin-bottom: 14px;
        padding: 8px 12px;
    }

    .auth-footer {
        padding: 12px 24px;
    }
}

/* very short screens (e.g. 1366x768 laptops) */
@media (min-width: 521px) and (max-height: 680px) {
    .auth-main,
    .auth-main.auth-wide {
        padding-top: 10px;
    }

    .brand,
    .auth-wide .brand {
        width: min(100%, 180px);
        margin-bottom: 6px;
    }

    .portal-label,
    .auth-wide .portal-label {
        margin-bottom: 10px;
    }

    .intro {
        margin-bottom: 10px;
    }

    .account-link {
        margin-top: 10px;
        padding-top: 8px;
    }

    .apps {
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (max-width: 520px) {
    .auth-main,
    .auth-main.auth-wide {
        width: calc(100% - 40px);
        margin-top: 28px;
    }

    .brand,
    .auth-wide .brand {
        width: min(100%, 310px);
    }

    .portal-label {
        margin-bottom: 28px;
    }

    h1 {
        font-size: 24px;
    }

    .field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .intro {
        font-size: 14px;
    }

    .auth-footer {
        line-height: 1.8;
    }
}
