/* =============================================================
   Auth screens — Module 2
   Inherits tokens from app.css. Full-height on mobile so these
   read as native app screens rather than web pages.
   ============================================================= */

.auth-body {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background: var(--bg);
}

.auth-glow {
    position: fixed;
    inset: -25% -20% auto -20%;
    height: 60vh;
    background:
        radial-gradient(55% 55% at 25% 25%, rgba(230, 51, 106, 0.30), transparent 70%),
        radial-gradient(45% 45% at 78% 12%, rgba(255, 122, 89, 0.26), transparent 70%);
    z-index: 0;
    pointer-events: none;
    animation: floatGlow 14s var(--ease) infinite alternate;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 2rem 1rem 3rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
}
.auth-brand i { color: var(--rose); }
.auth-brand:hover { color: var(--text); }

/* Logo variant — stacked, logo on top, name below, centered. */
.auth-brand--logo {
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.auth-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.auth-brand--logo span {
    font-family: var(--font-display, serif);
    font-size: 1.2rem;
}

.auth-card {
    padding: 2rem 1.75rem;
    animation: cardIn 0.5s var(--ease) both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

.auth-credit {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Headings ---------------------------------------------- */
.auth-head { margin-bottom: 1.5rem; }
.auth-head h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}
.auth-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.auth-head--center { text-align: center; }

.auth-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: var(--grad-brand);
    box-shadow: 0 12px 26px -10px rgba(230, 51, 106, 0.7);
}

/* ---- Fields ------------------------------------------------ */
.auth-form { display: flex; flex-direction: column; gap: 1.05rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}
.field-label .opt {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.link-subtle {
    font-size: 0.8rem;
    color: var(--rose);
    text-decoration: none;
    font-weight: 500;
}
.link-subtle:hover { text-decoration: underline; }

/* Input with leading icon */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i:first-child {
    position: absolute;
    left: 0.95rem;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}
.input-wrap .form-control {
    padding: 0.78rem 0.9rem 0.78rem 2.7rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input-wrap .form-control::placeholder { color: var(--text-muted); opacity: 0.65; }
.input-wrap .form-control:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(230, 51, 106, 0.14);
    background: var(--surface);
    color: var(--text);
}
.input-wrap .form-control.is-invalid {
    border-color: #dc2626;
    background-image: none;   /* drop Bootstrap's icon; we show our own */
}
.input-wrap .form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}
/* Date inputs need room for the native picker */
.input-wrap input[type="date"] { padding-right: 0.75rem; }

/* Password reveal */
.pw-toggle {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
    z-index: 2;
}
.pw-toggle:hover { color: var(--rose); }

/* Live username status */
.input-status {
    position: absolute;
    right: 0.85rem;
    font-size: 1rem;
    z-index: 2;
}
.input-status.ok  { color: #16a34a; }
.input-status.bad { color: #dc2626; }
.input-status.wait { color: var(--text-muted); }

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.field-hint #usernamePreview { color: var(--rose); font-weight: 600; }

.field-error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #dc2626;
    font-weight: 500;
    animation: shakeIn 0.3s var(--ease);
}
@keyframes shakeIn {
    0%   { transform: translateX(-4px); opacity: 0; }
    60%  { transform: translateX(2px); }
    100% { transform: none; opacity: 1; }
}

/* ---- Segmented control (gender) ---------------------------- */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.78rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.22s var(--ease);
}
.segmented label:hover { border-color: rgba(230, 51, 106, 0.4); }
.segmented input:checked + label {
    border-color: transparent;
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(230, 51, 106, 0.65);
    transform: translateY(-1px);
}
.segmented input:focus-visible + label {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}
.segmented.is-invalid-group label { border-color: #dc2626; }

/* ---- Password strength meter ------------------------------- */
.pw-meter {
    height: 5px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.pw-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #dc2626;
    transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.pw-meter[data-level="1"] span { width: 25%;  background: #dc2626; }
.pw-meter[data-level="2"] span { width: 50%;  background: #f0b429; }
.pw-meter[data-level="3"] span { width: 75%;  background: #3b82f6; }
.pw-meter[data-level="4"] span { width: 100%; background: #16a34a; }

/* ---- Checkbox line ----------------------------------------- */
.check-line {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.45;
}
.check-line input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--rose);
    flex-shrink: 0;
    cursor: pointer;
}
.check-line a { color: var(--rose); text-decoration: none; font-weight: 500; }
.check-line a:hover { text-decoration: underline; }

/* ---- Notice box -------------------------------------------- */
.notice-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.notice-box i { color: var(--rose); font-size: 1rem; margin-top: 1px; }

/* ---- Footer link ------------------------------------------- */
.auth-alt {
    text-align: center;
    margin: 1.4rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.auth-alt a { color: var(--rose); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---- Mobile: edge-to-edge app screen ----------------------- */
@media (max-width: 480px) {
    .auth-shell { padding: 1.25rem 0.75rem 2rem; }
    .auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: 22px;
    }
    .auth-head h1 { font-size: 1.5rem; }
    /* 16px min font-size stops iOS zooming on focus */
    .input-wrap .form-control { font-size: 16px; }
}
