/*
    Shared stylesheet for every Account page: Login, Register, ForgotPassword,
    ResetPassword, ChangePassword.

    Ported from the client's system-auth reference (src/app/system-auth):
    a 1000px two-panel card - a mockup image on the left, the form on the right -
    rather than the small centred card of the client-portal screens, which is a
    different product surface.

    Colour mapping. The reference leans on brand-primary / brand-secondary /
    neutral-slate-* / shadow-subtle-lg, and NONE of those are defined in its own
    stylesheets, so they render as nothing even there. They are mapped here onto
    concrete values: the brand blue is the panel's own --primary (#0A91E8), so the
    sign-in page and the app it signs you into agree, and the greys follow a
    standard slate ramp, which is what the names imply.

    text-h2 is inert in the reference for the same reason - it is declared outside
    @theme, so Tailwind never emits the utility - which leaves that heading at the
    browser's h2 default. 24px is that default, and it is what is used here.
*/

:root {
    --acc-primary: #0A91E8;
    --acc-primary-hover: #0880D3;
    --acc-page: #EAF4FC;
    --acc-card: #FFFFFF;

    --acc-slate-900: #0F172A;
    --acc-slate-800: #1E293B;
    --acc-slate-600: #475569;
    --acc-slate-500: #64748B;
    --acc-slate-400: #94A3B8;
    --acc-slate-300: #CBD5E1;
    --acc-slate-200: #E2E8F0;
    --acc-slate-50: #F8FAFC;

    --acc-danger: #EF4444;
    --acc-danger-bg: #FEF2F2;
    --acc-danger-line: #FECACA;

    --acc-radius: 8px;
    --acc-radius-card: 24px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.account {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--acc-page);
    color: var(--acc-slate-900);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- The two-panel card ---------- */

.acc-shell {
    width: 100%;
    max-width: 1000px;
    display: flex;
    background: var(--acc-card);
    border: 1px solid var(--acc-slate-200);
    border-radius: var(--acc-radius-card);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Left: the product mockup. Hidden on narrow screens, where the form takes the
   whole card - the same breakpoint the reference uses. */
.acc-aside {
    position: relative;
    width: 45%;
    flex: none;
    background: var(--acc-slate-50);
    border-right: 1px solid var(--acc-slate-200);
}

.acc-aside img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acc-main {
    width: 55%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--acc-card);
}

.acc-form-wrap { width: 100%; max-width: 448px; }

/* ---------- Header ---------- */

.acc-head { margin-bottom: 22px; }

/* No logo above the heading: the reference has none, and the left panel plus the
   heading already carry the brand. Kept as a rule for the other Account pages,
   which sit on a plain card with nothing else to identify them. */
.acc-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-bottom: 14px;
}

.acc-title {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--acc-slate-900);
}

.acc-sub {
    font-size: 14px;
    color: var(--acc-slate-500);
    margin: 4px 0 0;
}

/* ---------- Form ---------- */

.acc-form { display: flex; flex-direction: column; gap: 16px; }

.acc-field { display: flex; flex-direction: column; }

.acc-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.acc-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--acc-slate-900);
    margin: 0 0 6px;
}

/* Inside a label row the label supplies no margin of its own. */
.acc-label-row .acc-label { margin-bottom: 0; }

.acc-optional {
    font-weight: 400;
    color: var(--acc-slate-400);
    font-size: 12px;
    margin-left: 2px;
}

.acc-req { color: var(--acc-danger); }

.acc-control { position: relative; display: block; }

.acc-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--acc-slate-300);
    border-radius: var(--acc-radius);
    background: var(--acc-card);
    font-family: inherit;
    font-size: 14px;
    color: var(--acc-slate-900);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.acc-input::placeholder { color: var(--acc-slate-400); }
.acc-input:hover { border-color: var(--acc-slate-400); }

.acc-input:focus {
    outline: none;
    border-color: var(--acc-primary);
    box-shadow: 0 0 0 3px rgba(10, 145, 232, 0.16);
}

.acc-input.has-toggle { padding-right: 42px; }

.acc-lead {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--acc-slate-400);
    pointer-events: none;
}

.acc-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--acc-slate-400);
    cursor: pointer;
}
.acc-toggle:hover { color: var(--acc-slate-600); }
.acc-toggle:focus-visible { outline: 2px solid var(--acc-primary); outline-offset: 1px; }
.acc-toggle svg { display: block; }
.acc-toggle .ic-on { display: none; }
.acc-toggle.revealed .ic-off { display: none; }
.acc-toggle.revealed .ic-on { display: block; }

.acc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.acc-row > * { min-width: 0; }

.acc-msg {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--acc-danger);
}
.acc-msg:empty { display: none; }

.acc-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--acc-danger-line);
    border-radius: var(--acc-radius);
    background: var(--acc-danger-bg);
    color: #B91C1C;
    font-size: 13px;
    margin-bottom: 20px;
}
.acc-alert svg { flex: none; margin-top: 1px; }
.acc-alert span { display: block; }

/* ---------- Remember me ---------- */

.acc-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--acc-slate-600);
    cursor: pointer;
    user-select: none;
}
.acc-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: none;
    accent-color: var(--acc-primary);
}

/* ---------- Buttons ---------- */

/* The reference stacks the primary action and the Google button, primary first,
   with no divider between them. */
.acc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.acc-btn {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--acc-radius);
    background: var(--acc-primary);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}
.acc-btn:hover { background: var(--acc-primary-hover); }
.acc-btn:focus-visible { outline: 2px solid var(--acc-slate-900); outline-offset: 2px; }
.acc-btn svg { flex: none; }

.acc-btn-outline {
    background: var(--acc-card);
    border-color: var(--acc-slate-300);
    color: var(--acc-slate-900);
    gap: 10px;
}
.acc-btn-outline:hover { background: var(--acc-slate-50); border-color: var(--acc-slate-400); }
.acc-btn-outline svg { width: 20px; height: 20px; }

.acc-link {
    color: var(--acc-primary);
    font-weight: 600;
    text-decoration: none;
}
.acc-link:hover { color: var(--acc-primary-hover); text-decoration: underline; }
.acc-link:focus-visible { outline: 2px solid var(--acc-primary); outline-offset: 2px; border-radius: 3px; }

.acc-link-sm { font-size: 12px; }

.acc-foot {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--acc-slate-500);
}
.acc-foot .acc-link { font-weight: 700; }

/* ---------- Icon sprite ---------- */

/* Takes the <symbol> sprite out of flow. This CANNOT be an inline style
   attribute: these pages declare style-src without 'unsafe-inline', which blocks
   style attributes as well as <style> blocks. Left in flow the sprite is an
   inline element whose line box pushed the layout down 25px, producing a gap
   above the card and a scrollbar exactly that tall. */
.acc-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---------- Narrow screens ---------- */

/* Below the reference's lg breakpoint the mockup goes and the form takes the
   whole card. */
@media (max-width: 1023px) {
    .acc-aside { display: none; }
    .acc-main { width: 100%; }
}

@media (max-width: 640px) {
    body.account {
        padding: 0;
        background: var(--acc-card);
        align-items: flex-start;
    }
    .acc-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .acc-main { padding: 28px 20px 40px; }
    .acc-row { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .acc-input, .acc-btn, .acc-toggle { transition: none; }
}

/* Short viewports: give back vertical space before the page is forced to scroll.
   The controls keep their size; the decoration around them shrinks. */
@media (max-height: 760px) {
    body.account { padding: 20px; }
    .acc-main { padding: 24px 28px; }
    .acc-head { margin-bottom: 16px; }
    .acc-title { font-size: 19px; }
    .acc-form { gap: 13px; }
    .acc-foot { margin-top: 14px; }
}
