/* NookHaven login. Scoped to this page so the untouched register/app UI is unaffected. */
:root {
    --ink:#1C2B48;
    --muted:#526B8A;
    --line:#8BA3C5;
    --tint:#C4D8E5;
    --tint-strong:#DCEBF5;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: #E8ECEF;
    color-scheme: light;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body.login-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background-color: #E8ECEF;
    background-image: url('../../assets/images/login-background.svg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
button, input { font: inherit; }
.login-layout {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}
.login-card {
    width: min(100%, 490px);
    min-height: 0;
    padding: 48px 38px 42px;
    transform: none;
    border-radius: 20px;
    background: rgba(247, 252, 255, .92);
    box-shadow: 0 18px 34px rgba(30, 65, 104, .10);
    border: 1px solid rgba(255,255,255,.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}
.login-card::before {
    content: '';
    pointer-events: none;
    position: absolute;
    z-index: 1;
    width: 76px;
    height: 76px;
    left: 10px;
    top: -31px;
    background: url('../../assets/images/login-paperclip.svg') center / contain no-repeat;
}
.login-card h1 {
    margin: 0;
    color: #1C2B48;
    font-size: clamp(26px, 2.8vw, 33px);
    letter-spacing: -0.045em;
    font-weight: 750;
    line-height: 1.27;
    text-align: center;
    white-space: nowrap;
}
.login-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: #526B8A;
    text-align: center;
    margin: 17px 0 0;
    white-space: nowrap;
}
.login-form { margin-top: 33px; }
.input-group {
    height: 49px;
    margin: 0 0 17px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid var(--line);
    transition: border-color .18s ease;
}
.input-group:focus-within { border-bottom: 2px solid var(--ink); }
.input-group .field-icon {
    width: 27px;
    height: 27px;
    display: flex;
    flex: 0 0 27px;
    justify-content: center;
    align-items: center;
    color: #6A84A3;
}
.field-icon svg { width: 25px; height: 25px; }
.input-group input {
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 3px 0 0;
    border: 0;
    outline: 0;
    color: #1C2B48;
    background: transparent;
    font-size: 18px;
    font-weight: 400;
}
.input-group input::placeholder { color: #6C85A3; opacity: 1; }
.input-group:focus-within .field-icon { color: #1C2B48; }
.toggle-password {
    width: 32px;
    height: 32px;
    margin: 0 0 0 4px;
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 32px;
    border: 0;
    border-radius: 5px;
    color: #6A84A3;
    background: transparent;
    cursor: pointer;
    transition: color .18s, background .18s;
}
.toggle-password svg { width: 23px; height: 23px; }
.toggle-password:hover, .toggle-password[aria-pressed="true"] { color: #1C2B48; background: transparent; }
.toggle-password .eye-visible { display: none; }
.toggle-password[aria-pressed="true"] .eye-visible { display: block; }
.toggle-password[aria-pressed="true"] .eye-hidden { display: none; }
.login-assistance { text-align: right; margin-top: -4px; }
.text-action, .signup-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #1C2B48;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: color .18s ease, text-decoration-color .18s ease;
}
.text-action:hover, .signup-link:hover { color: #1C2B48; text-decoration: underline; text-underline-offset: 3px; }
.password-help {
    margin: 8px 0 0 auto;
    max-width: 350px;
    color: #60708D;
    font-size: 13px;
    line-height: 1.45;
    text-align: right;
}
.login-btn {
    display: block;
    width: 100%;
    min-height: 50px;
    margin-top: 29px;
    padding: 12px 18px;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.login-btn:hover:not(:disabled) {
    background: #23354D;
    box-shadow: 0 7px 16px rgba(88, 68, 147, .14);
    transform: translateY(-1px);
}
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { cursor: wait; opacity: .68; }
.login-status {
    margin: 15px 0 -29px;
    font-size: 13px;
    line-height: 1.45;
    color: #a62a21;
    text-align: center;
}
.login-status.success { color: #1C2B48; }
.signup-prompt {
    margin: 26px 0 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #1C2B48;
}
.signup-link { font-size: inherit; }
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid #8EB1D1;
    outline-offset: 4px;
}
.input-group input:focus-visible { outline: 0; }
@media (max-width: 650px) {
    body.login-page {
        background-attachment: scroll;
        background-position: center top;
    }

    /* Auto margins center the card on tall phones while allowing scrolling on short ones. */
    .login-layout {
        flex-direction: column;
        justify-content: flex-start;
        padding: 46px 16px 24px;
    }
    .login-card {
        width: 100%;
        min-height: auto;
        margin-block: auto;
        padding: 39px clamp(18px, 6vw, 28px) 33px;
        transform: none;
        border-radius: 18px;
    }
    .login-card::before {
        width: 70px;
        height: 70px;
        left: 8px;
        top: -27px;
    }
    .login-card h1 {
        font-size: clamp(24px, 6.2vw, 34px);
        line-height: 1.2;
        white-space: normal;
    }
    .login-subtitle {
        max-width: 36ch;
        margin: 16px auto 0;
        font-size: 14px;
        line-height: 1.5;
        white-space: normal;
    }
    .login-form { margin-top: 32px; }
    .input-group {
        height: 52px;
        gap: 12px;
        margin-bottom: 16px;
    }
    .input-group .field-icon {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
    }
    .field-icon svg { width: 23px; height: 23px; }
    .input-group input {
        font-size: 16px; /* Avoid iOS Safari zooming the page when an input gains focus. */
    }
    .toggle-password {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        margin-left: 0;
    }
    .login-assistance { margin-top: -4px; }
    .text-action {
        min-height: 44px;
        padding-block: 9px;
    }
    .password-help {
        max-width: 100%;
        font-size: 12px;
    }
    .login-status { margin: 12px 0 -18px; }
    .login-btn {
        min-height: 52px;
        margin-top: 28px;
        font-size: 18px;
    }
    .signup-prompt {
        margin-top: 26px;
        font-size: 13px;
    }
}
@media (max-width: 360px) {
    .login-layout { padding-inline: 12px; }
    .login-card { padding-inline: 19px; }
    .login-card::before {
        width: 60px;
        height: 60px;
        top: -24px;
    }
    .login-subtitle { font-size: 13px; }
}
@media (max-height: 600px) and (min-width: 651px) {
    /* Compact layout for phones held horizontally without affecting desktop screens. */
    .login-card {
        min-height: auto;
        padding: 36px 40px 32px;
        transform: none;
    }
    .login-subtitle { margin-top: 15px; }
    .login-form { margin-top: 25px; }
    .input-group { margin-bottom: 12px; }
    .login-btn { margin-top: 26px; }
    .signup-prompt { margin-top: 23px; }
}
@media (max-height: 700px) and (min-width: 651px) {
    .login-layout { align-items: flex-start; }
    .login-card { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .login-btn, .toggle-password, .input-group, .text-action, .signup-link { transition: none; }
}

/* 2026-11-06 mobile refinement: calmer spacing and a shorter card,
   without reducing form controls below comfortable phone tap sizes. */
@media (max-width: 650px) {
    .login-layout { padding: 38px 16px 22px; }
    .login-card {
        width: min(100%, 410px);
        padding: 38px clamp(20px, 5.5vw, 27px) 29px;
    }
    .login-card::before { width: 63px; height: 63px; top: -25px; }
    .login-card h1 { font-size: clamp(23px, 6vw, 30px); }
    .login-subtitle { font-size: 13.5px; margin-top: 11px; }
    .login-form { margin-top: 24px; }
    .input-group { height: 49px; margin-bottom: 13px; }
    .login-assistance { margin-top: 0; }
    .text-action { min-height: 42px; padding-block: 9px; }
    .login-btn { min-height: 50px; margin-top: 19px; }
    .signup-prompt { margin-top: 19px; }
}
@media (max-width: 360px) {
    .login-layout { padding-inline: 12px; }
    .login-card { padding-inline: 19px; }
    .login-card::before { width: 57px; height: 57px; top: -23px; }
    .login-subtitle { font-size: 13px; }
}

/* Lavender design update: styling only; current login behavior is preserved. */
.login-brand-mark { display:block; width:74px; height:59px; object-fit:contain; margin:0 auto 16px; }
.login-card { border:1px solid #B8D2E4; box-shadow:0 18px 42px rgba(69,52,119,.09); }
.login-card::before { opacity:.65; }
.login-card h1 { color:#1C2B48; }
.login-subtitle { color:#60708D; }
.input-group { border-color:#A7C7E7; }
.login-btn { box-shadow:0 4px 10px rgba(88,68,147,.07); }
@media (max-width:650px) { .login-brand-mark { width:65px; height:52px; margin-bottom:13px; } }
