/*
 * Login / account-recovery pages.
 *
 * These pages are rendered by the Community Auth "examples" views
 * (application/third_party/community_auth/views/examples/), NOT through the
 * Template library, so they get none of the admin chrome and none of the admin
 * stylesheets beyond what page_header.php links explicitly. This file is that
 * page's whole appearance.
 *
 * Requires colors.css to be loaded first - every colour here is a token, and
 * the previous inline styles in page_header.php were the reason the input
 * borders were invisible: hks_custom.css referenced var(--border-strong) while
 * colors.css, which defines it, was never linked on this page.
 */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Roboto Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text);
    /* Brand blue washed out toward the page background, so the white card in
       the middle has something to sit on without competing with the logo. */
    background: var(--surface-page);
    background-image: linear-gradient(160deg, var(--blue-05) 0%, var(--blue-10) 55%, var(--blue-20) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* The wrapper is shared with the other examples views (recover, choose
   password), so it stays a plain centred column and the card styling below is
   opt-in through .auth-card. */
.wrap_login_page {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 380px;
    padding: 24px 16px;
    box-sizing: border-box;
}

.login-image {
    background: url(../img/HKS.svg) no-repeat center center;
    background-size: contain;
    height: 120px;
    margin-bottom: 20px;
}

/* ---------------------------------------------------------------- the card */

.auth-card {
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 28px 26px 26px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

/* Thin brand rule along the top edge, same device as the navbar accent. */
.auth-card {
    border-top: 3px solid var(--primary);
}

.auth-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-strong);
    text-align: center;
}

.auth-card .auth-subtitle {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* -------------------------------------------------------------- the fields */

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.auth-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 0 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-strong);
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:hover {
    border-color: var(--blue-40);
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Chrome paints its own pale-yellow fill over autofilled inputs, which loses
   the border contrast this page is about. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface-card) inset;
    -webkit-text-fill-color: var(--text-strong);
}

/* ----------------------------------------------------------- remember / cta */

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 20px;
    font-size: 13px;
    color: var(--text-soft);
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.auth-remember label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.auth-submit {
    display: block;
    width: 100%;
    height: 44px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--on-primary);
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    background: var(--primary-hover);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.auth-submit:active {
    background: var(--blue-90);
}

.auth-links {
    margin: 18px 0 0;
    font-size: 13px;
    text-align: center;
}

.auth-links a {
    color: var(--link);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* ---------------------------------------------------------------- messages */

.auth-alert {
    margin: 0 0 18px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
    border-radius: 6px;
}

.auth-alert p {
    margin: 0;
}

.auth-alert p + p {
    margin-top: 6px;
}

.auth-alert-error {
    color: var(--status-danger-txt);
    background: var(--status-danger-bg);
    border-color: var(--status-danger);
}

.auth-alert-success {
    color: var(--status-success);
    background: var(--status-success-bg);
    border-color: var(--status-success);
}

.auth-alert-strong {
    font-weight: 700;
}

.auth-footnote {
    margin: 16px 0 0;
    font-size: 11px;
    color: var(--text-faint);
    text-align: center;
}

/* -------------------------------------------------------------- small screens
 * Below ~420px the fixed centring wastes space and a tall card can overflow
 * the viewport, so the layout falls back to normal document flow. */
@media (max-width: 420px), (max-height: 560px) {

    .wrap_login_page {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        padding: 28px 14px 40px;
    }

    .login-image {
        height: 90px;
    }

    .auth-card {
        padding: 22px 18px;
    }
}
