/* Sign-in / forgot / reset password. Same design language as the public website. */
:root {
    --ink: #15201b; --ink-2: #2c3833; --muted: #5d6a63;
    --line: rgba(21, 32, 27, .14); --line-2: rgba(21, 32, 27, .24);
    --forest: #1d3a2e; --forest-2: #254a3b; --sage: #a3b6a0;
    --paper: #fbf8f2; --sand: #f3ece0; --white: #fff;
    --clay: #b65a35; --clay-2: #9c4826; --clay-soft: #f6e1d6;
    --ok: #2f7a55; --ok-soft: #dff0e5; --danger: #b3261e; --danger-soft: #fbe6e4;
    --ff-display: "Fraunces", Georgia, serif;
    --ff-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--ff-body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-size: 15.5px; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ai { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, 1fr); }

/* Visual side */
.auth-visual { position: relative; overflow: hidden; color: #fff; background: var(--forest); display: flex; flex-direction: column; padding: 40px clamp(32px, 4vw, 64px); isolation: isolate; }
.auth-visual-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: drift 24s var(--ease) infinite alternate; }
@keyframes drift { from { transform: scale(1.08) translate3d(0, 0, 0); } to { transform: scale(1.02) translate3d(-1.5%, -1%, 0); } }
.auth-visual-shade { position: absolute; inset: 0; z-index: -1; background:
    linear-gradient(90deg, rgba(12, 22, 17, .5) 0%, rgba(12, 22, 17, .15) 65%, rgba(12, 22, 17, 0) 100%),
    linear-gradient(180deg, rgba(12, 22, 17, .55) 0%, rgba(12, 22, 17, 0) 28%, rgba(12, 22, 17, .35) 52%, rgba(12, 22, 17, .92) 100%); }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; }
.auth-logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 6px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .4); flex: none; }
.auth-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-brand-name { font-family: var(--ff-display); font-size: 21px; font-weight: 450; letter-spacing: -.01em; }
.auth-visual-copy { max-width: 560px; margin-top: auto; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--clay); margin-bottom: 16px; }
.auth-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.auth-eyebrow--light { color: #ecd9c4; }
.auth-visual-title { font-family: var(--ff-display); font-weight: 330; font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.02em; }
.auth-visual-title em { font-style: italic; color: #f0b08f; }
.auth-points { display: grid; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .2); }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, .86); }
.auth-points .ai { width: 20px; height: 20px; color: #f0b08f; }
.auth-visual-foot { font-size: 13px; color: rgba(255, 255, 255, .6); margin-top: 28px; }

/* Form side */
.auth-panel { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 28px clamp(24px, 5vw, 72px); background:
    radial-gradient(circle at 100% 0%, rgba(182, 90, 53, .08), transparent 40%), var(--paper); }
.auth-panel-top { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.auth-brand--mobile { display: none; margin-right: auto; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.auth-back:hover { color: var(--ink); border-color: var(--ink); }
.auth-back { white-space: nowrap; flex: none; }
.auth-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 420px; margin: 0 auto; padding: 40px 0; animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.auth-title { font-family: var(--ff-display); font-weight: 380; font-size: clamp(2.2rem, 4vw, 2.9rem); line-height: 1.05; letter-spacing: -.02em; }
.auth-title em { font-style: italic; font-weight: 340; color: var(--clay); }
.auth-lede { color: var(--muted); margin: 12px 0 32px; }
.auth-lede strong { color: var(--ink); font-weight: 600; }
.auth-panel-foot { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-panel-foot .ai { color: var(--forest); }

/* Alerts */
.auth-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14.5px; margin-bottom: 24px; }
.auth-alert .ai { width: 20px; height: 20px; margin-top: 1px; }
.auth-alert--error { background: var(--danger-soft); color: var(--danger); }
.auth-alert--success { background: var(--ok-soft); color: #1f5a3b; }
.auth-alert a { font-weight: 700; }

/* Fields */
.auth-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field-link { font-size: 13.5px; font-weight: 700; color: var(--clay); text-decoration: none; }
.field-link:hover { color: var(--clay-2); text-decoration: underline; text-underline-offset: 3px; }
.control { position: relative; }
.control > .ai { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; transition: color .2s; }
.control input { width: 100%; height: 54px; padding: 0 16px 0 48px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); font-size: 15.5px; transition: border-color .2s, box-shadow .2s; }
.control input::placeholder { color: #9aa49e; }
.control input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(29, 58, 46, .1); }
.control:focus-within > .ai { color: var(--forest); }
.control input[readonly] { background: var(--sand); color: var(--ink-2); }
.control--pw input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--sand); }
.pw-toggle .ai { width: 20px; height: 20px; }
.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, .1); }
.field-error { font-size: 13px; color: var(--danger); }
.field-hint { font-size: 13px; color: var(--muted); }
.caps { font-size: 12.5px; color: #8a5a00; display: inline-flex; align-items: center; gap: 6px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--white) center / 14px no-repeat; cursor: pointer; transition: background-color .15s, border-color .15s; }
.check input:checked { background-color: var(--forest); border-color: var(--forest); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.check input:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--clay); color: #fff; font-weight: 700; font-size: 15.5px; letter-spacing: .01em; cursor: pointer; text-decoration: none; transition: background .2s, box-shadow .2s, transform .15s; }
.btn:hover { background: var(--clay-2); box-shadow: 0 14px 28px -14px rgba(182, 90, 53, .9); }
.btn:active { transform: translateY(1px); }
.btn .ai { transition: transform .3s var(--ease); }
.btn:hover .ai { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: var(--ink); color: #fff; box-shadow: none; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .ai { display: none; }
.btn.is-loading::after { content: ""; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alt { text-align: center; font-size: 14.5px; color: var(--muted); margin-top: 28px; }
.auth-alt a { color: var(--ink); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.auth-alt a:hover { color: var(--clay); }

/* Sent / done state */
.auth-state { text-align: center; }
.auth-state-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 24px; background: var(--clay-soft); color: var(--clay); position: relative; }
.auth-state-icon::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px dashed rgba(182, 90, 53, .35); animation: spin 18s linear infinite; }
.auth-state-icon .ai { width: 34px; height: 34px; }
.auth-state .auth-lede { margin-bottom: 28px; }
.auth-tips { text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 24px; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.auth-tips li { display: flex; gap: 10px; }
.auth-tips .ai { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; stroke-width: 2; }
.auth-actions { display: grid; gap: 10px; }

/* Password strength */
.strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-top: 2px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line); transition: background .25s; }
.strength span { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 52px; text-align: right; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: #d08a1c; }
.strength[data-level="3"] i:nth-child(-n+3) { background: #5a9a62; }
.strength[data-level="4"] i { background: var(--ok); }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 8px; transition: color .2s; }
.rules li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; background: center / 11px no-repeat; transition: all .2s; }
.rules li.is-met { color: var(--ok); }
.rules li.is-met::before { border-color: var(--ok); background-color: var(--ok); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* Responsive */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-brand--mobile { display: inline-flex; }
    .auth-brand--mobile .auth-brand-name { font-size: 19px; }
    .auth-brand--mobile .auth-logo { border: 1px solid var(--line); box-shadow: none; }
    .auth-back span, .auth-back { font-size: 13px; }
}
@media (max-width: 520px) {
    .auth-panel { padding: 18px 18px 22px; }
    .auth-back { padding: 8px 12px; }
    .auth-back-long { display: none; }
    .auth-back > span { text-transform: capitalize; }
    .auth-brand--mobile { min-width: 0; }
    .auth-brand--mobile .auth-brand-name { font-size: 17px; }
    .auth-brand--mobile .auth-logo { width: 38px; height: 38px; border-radius: 10px; }
    .auth-body { padding: 28px 0; justify-content: flex-start; }
    .rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
