/* ==========================================================================
   RoofLocal — Auth pages stylesheet
   --------------------------------------------------------------------------
   Dark, minimal, brand-consistent shell for /login, /forgot-password,
   /reset-password/<t>, /check-email, /billing-required, and the verification
   failure page. Mirrors the look of the brand homepage (templates/landing/
   brand_home.html + static/css/brand-home.css) without coupling to it.

   Tokens are duplicated from brand-home.css on purpose so this file works
   standalone (the auth templates do NOT pull in brand-home.css). Keep the
   token values in sync if the brand palette changes.
   ========================================================================== */

:root {
    --rl-bg:           #0d0d0f;
    --rl-bg-elevated:  #17171a;
    --rl-surface:      #1f1f24;
    --rl-surface-2:    #1a1a1d;
    --rl-border:       #2a2a30;
    --rl-border-soft:  #232329;
    --rl-text:         #f5f5f5;
    --rl-text-muted:   #a8a8b3;
    --rl-text-dim:     #7a7a85;
    --rl-accent:       #e53935;
    --rl-accent-hover: #ff4757;
    --rl-accent-soft:  rgba(229, 57, 53, 0.12);
    --rl-radius:       10px;
    --rl-radius-lg:    16px;
    --rl-shadow:       0 6px 22px rgba(0, 0, 0, 0.35);
    --rl-shadow-red:   0 8px 26px rgba(229, 57, 53, 0.30);
    --rl-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--rl-font);
    background: var(--rl-bg);
    color: var(--rl-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ─────────────── Two-column shell ─────────────── */
.rl-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--rl-bg);
}

@media (max-width: 900px) {
    .rl-auth-shell { grid-template-columns: 1fr; }
}

/* ─────────────── Brand (left) panel ─────────────── */
.rl-auth-brand {
    position: relative;
    overflow: hidden;
    padding: 3.5rem 3rem;
    background:
        radial-gradient(circle at 85% 15%, rgba(229, 57, 53, 0.14), transparent 55%),
        linear-gradient(160deg, #0d0d0f 0%, #17171a 55%, #1f1f24 100%);
    border-right: 1px solid var(--rl-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--rl-text);
}

.rl-auth-brand::after {
    content: '';
    position: absolute;
    inset: auto -40% -40% auto;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(229, 57, 53, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.rl-auth-brand > * { position: relative; z-index: 1; }

@media (max-width: 900px) {
    .rl-auth-brand {
        border-right: none;
        border-bottom: 1px solid var(--rl-border);
        padding: 2rem 1.5rem;
    }
}

.rl-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--rl-text);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.04em;
}

.rl-auth-accent { color: var(--rl-accent); }

.rl-auth-pitch {
    margin-top: 4rem;
    max-width: 28rem;
}

.rl-auth-pitch-eyebrow {
    color: var(--rl-text-dim);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

.rl-auth-pitch-headline {
    color: var(--rl-text);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 1.1rem;
}

.rl-auth-pitch-body {
    color: var(--rl-text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.rl-auth-brand-foot {
    color: var(--rl-text-dim);
    font-size: 0.82rem;
    margin-top: 3rem;
}

/* On mobile the brand panel collapses to a compact header — hide the
   pitch + footer line so it doesn't push the form below the fold. */
@media (max-width: 900px) {
    .rl-auth-pitch,
    .rl-auth-brand-foot { display: none; }
    .rl-auth-brand { padding: 1.6rem 1.5rem; }
}

/* ─────────────── Form (right) column ─────────────── */
.rl-auth-form-col {
    background: var(--rl-bg);
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .rl-auth-form-col { padding: 2.5rem 1.5rem 4rem; }
}

.rl-auth-card {
    width: 100%;
    max-width: 26rem;
}

.rl-auth-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--rl-text);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.rl-auth-subtitle {
    color: var(--rl-text-muted);
    font-size: 0.95rem;
    margin: 0 0 2rem;
    line-height: 1.55;
}

.rl-auth-subtitle strong { color: var(--rl-text); font-weight: 600; }

.rl-status-block { text-align: center; }
.rl-status-block .rl-auth-title { text-align: center; }
.rl-status-block .rl-auth-subtitle { text-align: center; }

/* ─────────────── Alerts (flash) ─────────────── */
.rl-alert-stack { margin-bottom: 1.25rem; }

.rl-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--rl-radius);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid;
}

.rl-alert-success {
    background: rgba(34, 197, 94, 0.10);
    color: #6ee29c;
    border-color: rgba(34, 197, 94, 0.35);
}
.rl-alert-info {
    background: rgba(56, 189, 248, 0.10);
    color: #80d8ff;
    border-color: rgba(56, 189, 248, 0.35);
}
.rl-alert-warning {
    background: rgba(245, 158, 11, 0.10);
    color: #f7c264;
    border-color: rgba(245, 158, 11, 0.35);
}
.rl-alert-error,
.rl-alert-danger {
    background: rgba(229, 57, 53, 0.10);
    color: #ff7a76;
    border-color: rgba(229, 57, 53, 0.35);
}

.rl-alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.65;
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.rl-alert-close:hover { opacity: 1; }

/* ─────────────── Form controls ─────────────── */
.rl-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.rl-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.rl-label {
    color: var(--rl-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.rl-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--rl-surface);
    border: 1px solid var(--rl-border);
    border-radius: var(--rl-radius);
    color: var(--rl-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.rl-input::placeholder { color: var(--rl-text-dim); }

.rl-input:focus {
    outline: none;
    border-color: var(--rl-accent);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18);
    background: var(--rl-bg-elevated);
}

/* Keep autofilled inputs dark — Chrome's default override is white */
.rl-input:-webkit-autofill,
.rl-input:-webkit-autofill:hover,
.rl-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--rl-text);
    -webkit-box-shadow: 0 0 0 1000px var(--rl-surface) inset;
    caret-color: var(--rl-text);
    border-color: var(--rl-border);
}

.rl-form-error {
    color: #ff7a76;
    font-size: 0.82rem;
    margin: 0.15rem 0 0;
}

.rl-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Custom dark checkbox for "Remember me". Replaces the LeadCull switch. */
.rl-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    color: var(--rl-text-muted);
    font-size: 0.88rem;
    user-select: none;
}

.rl-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    border: 1px solid var(--rl-border);
    background: var(--rl-surface);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background 120ms ease, border-color 120ms ease;
    flex-shrink: 0;
}

.rl-checkbox input[type="checkbox"]:checked {
    background: var(--rl-accent);
    border-color: var(--rl-accent);
}

.rl-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

.rl-checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--rl-accent);
    outline-offset: 2px;
}

/* ─────────────── Links ─────────────── */
.rl-link {
    color: var(--rl-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 120ms ease;
}
.rl-link:hover { color: var(--rl-accent); }

.rl-link-accent { color: var(--rl-accent); font-weight: 600; }
.rl-link-accent:hover { color: var(--rl-accent-hover); }

/* ─────────────── Buttons ─────────────── */
.rl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 1.4rem;
    border-radius: var(--rl-radius);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 160ms ease, transform 120ms ease, border-color 160ms ease;
    line-height: 1;
    font-family: inherit;
}

.rl-btn-primary {
    background: var(--rl-accent);
    color: #fff;
    box-shadow: var(--rl-shadow-red);
}
.rl-btn-primary:hover {
    background: var(--rl-accent-hover);
    transform: translateY(-1px);
}

.rl-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--rl-text);
    border-color: var(--rl-border);
}
.rl-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--rl-text-muted);
}

.rl-btn-block { width: 100%; }
.rl-btn-sm { padding: 0.6rem 1rem; font-size: 0.85rem; }

/* ─────────────── Resend block ─────────────── */
.rl-resend-box {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: var(--rl-surface);
    border: 1px solid var(--rl-border);
    border-radius: var(--rl-radius);
    text-align: center;
}

.rl-resend-box p {
    margin: 0 0 0.75rem;
    color: var(--rl-text-muted);
    font-size: 0.88rem;
}

/* ─────────────── Card footer ("Already have an account? Sign in") ─────────── */
.rl-auth-cta-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--rl-text-muted);
    font-size: 0.88rem;
}

.rl-auth-cta-footer p { margin: 0; }

/* ─────────────── Status icon (check-email, verification-failed) ─────────── */
.rl-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
}
.rl-status-icon-info {
    background: rgba(56, 189, 248, 0.12);
    color: #80d8ff;
}
.rl-status-icon-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f7c264;
}
.rl-status-icon-error {
    background: rgba(229, 57, 53, 0.12);
    color: var(--rl-accent);
}

.rl-status-instructions {
    text-align: center;
    color: var(--rl-text-muted);
    font-size: 0.9rem;
    margin: 1rem 0 1.5rem;
}
.rl-status-instructions p { margin: 0 0 0.5rem; }
.rl-status-instructions p:last-child { color: var(--rl-text-dim); }

/* ─────────────── Billing pricing card ─────────────── */
.rl-pricing-card {
    background: var(--rl-surface);
    border: 1px solid var(--rl-border);
    border-radius: var(--rl-radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.rl-pricing-plan {
    color: var(--rl-text);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.rl-pricing-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    justify-content: center;
}
.rl-pricing-amount { font-size: 2.2rem; font-weight: 800; color: var(--rl-text); }
.rl-pricing-period { color: var(--rl-text-muted); font-size: 0.95rem; }

.rl-pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    text-align: left;
}
.rl-pricing-feature {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0;
    color: var(--rl-text-muted);
    font-size: 0.92rem;
}
.rl-pricing-feature svg { color: #6ee29c; flex-shrink: 0; }

.rl-pricing-trial {
    text-align: center;
    color: var(--rl-accent);
    font-weight: 600;
    font-size: 0.85rem;
    margin: 1rem 0 0;
}

.rl-billing-note {
    text-align: center;
    color: var(--rl-text-dim);
    font-size: 0.82rem;
    margin: 1rem 0;
}

/* Task #251 — official circular RoofLocal logo in the auth panel.
   Replaces the previous SVG house mark + text wordmark. */
.rl-auth-logo .rl-logo-img {
    display: block;
    height: 36px;
    width: auto;
    object-fit: contain;
}
@media (max-width: 600px) {
    .rl-auth-logo .rl-logo-img { height: 32px; }
}
