/* ═══════════════════════════════════════════════════════════
   SISONKE AUTH — Login & Register design system
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────── */
:root {
    --auth-forest:        #0F2419;
    --auth-forest-mid:    #1A3C2A;
    --auth-forest-light:  #2D5A3D;
    --auth-sage:          #4A7C5C;
    --auth-gold:          #C9922A;
    --auth-gold-light:    #E8B84B;
    --auth-gold-pale:     #FBF0D9;
    --auth-cream:         #FAF7F2;
    --auth-earth:         #8B6F47;
    --auth-text:          #1A1A1A;
    --auth-muted:         #6B7280;
    --auth-border:        #E8E0D5;
    --auth-input-bg:      #FDFAF6;
    --auth-error:         #C0392B;
    --auth-success:       #2D7D46;
}

/* ── Full-page split layout ─────────────────────────────── */
.auth-split {
    display: flex;
    min-height: 100vh;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    color: var(--auth-text);
}

/* ── Override body background for auth pages ────────────── */
body:has(.auth-split) {
    background: var(--auth-forest);
}

/* ═══════════════════════════════════════════════════════════
   LEFT BRAND PANEL
   ═══════════════════════════════════════════════════════════ */
.auth-brand {
    width: 50%;
    background: var(--auth-forest);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 56px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Radial depth gradients */
.auth-brand::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(201,146,42,0.13) 0%, transparent 65%);
    pointer-events: none;
}
.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(45,90,61,0.3) 0%, transparent 70%);
    pointer-events: none;
}

/* Rotating circle motif */
.auth-circles {
    position: absolute;
    top: 50%;
    right: -100px;
    transform: translateY(-50%);
    opacity: 0.07;
    pointer-events: none;
}
.auth-circles svg {
    animation: authRotate 50s linear infinite;
}
@keyframes authRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Beadwork dot grid (5 × 4) */
.auth-beads {
    position: absolute;
    bottom: 48px;
    right: 48px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    opacity: 0.2;
    pointer-events: none;
}
.auth-bead {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--auth-gold);
    animation: authBeadPulse 3.2s ease-in-out infinite;
}
.auth-bead:nth-child(odd)  { animation-delay: 0.4s; }
.auth-bead:nth-child(3n)   { animation-delay: 1.1s; background: var(--auth-gold-light); }
@keyframes authBeadPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.4); }
}

/* Brand content sits above decorative layers */
.auth-brand-content {
    position: relative;
    z-index: 1;
}

/* Logo mark + wordmark */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 52px;
}
.auth-logo-mark {
    width: 46px;
    height: 46px;
    background: var(--auth-gold);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-forest);
    flex-shrink: 0;
}
.auth-logo-name {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.4px;
}

/* Hero headline */
.auth-brand-headline {
    font-family: 'Playfair Display', serif;
    font-size: 43px;
    font-weight: 700;
    color: #fff;
    line-height: 1.18;
    margin: 0 0 18px;
    letter-spacing: -0.5px;
}
.auth-brand-headline em {
    font-style: italic;
    color: var(--auth-gold);
}

.auth-brand-sub {
    color: rgba(255,255,255,0.58);
    font-size: 15px;
    line-height: 1.65;
    max-width: 380px;
    margin: 0 0 48px;
}

/* Stats row */
.auth-stats {
    display: flex;
    gap: 36px;
    margin-bottom: 48px;
}
.auth-stat-number {
    display: block;
    font-family: 'DM Mono', 'Courier New', monospace;
    font-size: 26px;
    font-weight: 500;
    color: var(--auth-gold);
    line-height: 1;
}
.auth-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    margin-top: 4px;
}

/* Testimonial */
.auth-testimonial {
    border-left: 2px solid rgba(201,146,42,0.38);
    padding-left: 20px;
    max-width: 400px;
    margin: 0;
}
.auth-testimonial q {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 14px;
    color: rgba(255,255,255,0.52);
    line-height: 1.7;
    quotes: none;
    display: block;
    margin-bottom: 10px;
}
.auth-testimonial-author {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.33);
    letter-spacing: 0.4px;
}

/* ═══════════════════════════════════════════════════════════
   RIGHT FORM PANEL
   ═══════════════════════════════════════════════════════════ */
.auth-form-panel {
    width: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    min-height: 100vh;
    position: relative;
}
.auth-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 15%, rgba(201,146,42,0.045) 0%, transparent 55%);
    pointer-events: none;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}
.auth-mobile-logo-mark {
    width: 38px;
    height: 38px;
    background: var(--auth-forest);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--auth-gold);
}
.auth-mobile-logo-name {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--auth-forest);
}

/* ── Tab switcher ───────────────────────────────────────── */
.auth-tabs {
    display: flex;
    background: var(--auth-cream);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 30px;
    border: 1px solid var(--auth-border);
    gap: 2px;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--auth-muted);
    text-decoration: none !important;
    transition: all 0.18s ease;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.auth-tab.active {
    background: #fff;
    color: var(--auth-forest);
    font-weight: 600;
    box-shadow: 0 1px 5px rgba(0,0,0,0.09);
}
.auth-tab:hover:not(.active) {
    color: var(--auth-forest-light);
    text-decoration: none !important;
}

/* Form headings */
.auth-form-heading {
    font-family: 'Playfair Display', serif;
    font-size: 27px;
    font-weight: 700;
    color: var(--auth-forest);
    margin: 0 0 5px;
    line-height: 1.2;
}
.auth-form-subheading {
    font-size: 14px;
    color: var(--auth-muted);
    margin: 0 0 26px;
}

/* ── Status / error messages ────────────────────────────── */
.auth-split .alert {
    border-radius: 8px;
    border-left-width: 4px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}
.auth-split .alert-danger {
    background: rgba(192,57,43,0.07);
    border-color: var(--auth-error);
    color: var(--auth-error);
}
.auth-split .alert-success {
    background: rgba(45,125,70,0.07);
    border-color: var(--auth-success);
    color: var(--auth-success);
}

/* ValidationSummary — hide when no errors */
.auth-error-alert.validation-summary-valid { display: none !important; }
.auth-error-alert.validation-summary-errors {
    background: rgba(192,57,43,0.07);
    border: 1px solid rgba(192,57,43,0.28);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--auth-error);
    margin-bottom: 20px;
}
.auth-error-alert.validation-summary-errors ul {
    margin: 0;
    padding-left: 16px;
}
.auth-error-alert.validation-summary-errors li {
    margin-bottom: 2px;
}

/* ── Form fields ────────────────────────────────────────── */
.auth-field {
    margin-bottom: 18px;
}
.auth-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--auth-forest-light);
    margin-bottom: 6px;
    font-family: 'DM Sans', sans-serif;
}
.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.auth-label-row .auth-label {
    margin-bottom: 0;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    opacity: 0.42;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}
.auth-input-wrapper:focus-within .auth-input-icon {
    opacity: 0.72;
}

/* The actual <input> rendered by Blazor's InputText */
.auth-input {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    padding: 12px 14px 12px 42px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input::placeholder { color: #C0B9AE; }
.auth-input:focus {
    border-color: var(--auth-forest-light);
    box-shadow: 0 0 0 3px rgba(26,60,42,0.08);
    background: #fff;
}
/* Blazor validation state classes */
.auth-input.modified.valid   { border-color: var(--auth-success); }
.auth-input.modified.invalid { border-color: var(--auth-error); }

/* Input with room for right-side toggle */
.auth-input.has-toggle { padding-right: 44px; }

/* Phone prefix variant */
.auth-phone-wrap .auth-input-icon {
    left: 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    opacity: 0.7;
}
.auth-phone-wrap .auth-input.phone-input { padding-left: 68px; }

/* Password show/hide toggle */
.auth-pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.4;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.18s;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
}
.auth-pw-toggle:hover { opacity: 0.85; }

/* ValidationMessage — hide when no errors */
.auth-val-msg.field-validation-valid  { display: none !important; }
.auth-val-msg.field-validation-invalid {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    color: var(--auth-error);
    font-size: 11.5px;
    margin-top: 5px;
    font-family: 'DM Sans', sans-serif;
}
.auth-val-msg.field-validation-invalid::before { content: '⚠'; flex-shrink: 0; }

/* Forgot password link */
.auth-forgot {
    font-size: 12px;
    color: var(--auth-sage);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.auth-forgot:hover { color: var(--auth-gold); text-decoration: none; }

/* Remember me */
.auth-remember {
    margin-bottom: 20px;
}
.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}
.auth-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--auth-forest);
    cursor: pointer;
    flex-shrink: 0;
}
.auth-checkbox-text {
    font-size: 13.5px;
    color: var(--auth-muted);
    font-family: 'DM Sans', sans-serif;
}

/* ── Buttons ────────────────────────────────────────────── */
.auth-btn-primary {
    display: block;
    width: 100%;
    background: var(--auth-forest);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    margin-bottom: 18px;
    letter-spacing: 0.1px;
}
.auth-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 35%, rgba(201,146,42,0.28) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}
.auth-btn-primary:hover {
    background: var(--auth-forest-mid);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(15,36,25,0.28);
    color: #fff;
    text-decoration: none !important;
}
.auth-btn-primary:hover::before { opacity: 1; }
.auth-btn-primary:active { transform: translateY(0); }

.auth-btn-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--auth-forest);
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    padding: 11px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    margin-bottom: 10px;
}
.auth-btn-secondary:hover {
    background: var(--auth-cream);
    border-color: var(--auth-sage);
    color: var(--auth-forest);
    text-decoration: none !important;
}

.auth-btn-back {
    background: none;
    border: none;
    color: var(--auth-sage);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-btn-back:hover { color: var(--auth-forest); text-decoration: none; }

/* ── Divider ────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0 14px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* Switch / helper links */
.auth-switch {
    text-align: center;
    font-size: 13.5px;
    color: var(--auth-muted);
    margin-top: 18px;
    margin-bottom: 6px;
    font-family: 'DM Sans', sans-serif;
}
.auth-switch a {
    color: var(--auth-sage);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover { color: var(--auth-gold); text-decoration: none; }
.auth-switch.small { font-size: 12px; margin-top: 8px; }
.auth-switch.small a { color: var(--auth-muted); }

/* ═══════════════════════════════════════════════════════════
   REGISTER — 3-STEP WIZARD
   ═══════════════════════════════════════════════════════════ */

/* Step indicator bar */
.auth-step-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 0;
}
.auth-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
    font-family: 'DM Mono', monospace;
}
.auth-step-dot.active {
    background: var(--auth-forest);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(15,36,25,0.12);
}
.auth-step-dot.done {
    background: var(--auth-success);
    color: #fff;
}
.auth-step-line {
    flex: 1;
    height: 2px;
    background: #E5E7EB;
    max-width: 64px;
    transition: background 0.25s;
}
.auth-step-line.done { background: var(--auth-success); }

.auth-step-label {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin-bottom: 22px;
    font-family: 'DM Sans', sans-serif;
}

/* Wizard step panels — CSS controls show/hide */
.auth-wizard-step { display: none; }
.auth-wizard-step.active { display: block; }

/* Nav buttons row at bottom of each step */
.auth-step-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}
.auth-step-nav .auth-btn-primary {
    margin-bottom: 0;
    flex: 1;
}

/* Password strength meter */
.auth-strength {
    margin-top: 8px;
}
.auth-strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
}
.auth-strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #E5E7EB;
    transition: background 0.25s;
}
.auth-strength-bar.s-weak   { background: var(--auth-error); }
.auth-strength-bar.s-fair   { background: var(--auth-gold); }
.auth-strength-bar.s-good   { background: var(--auth-sage); }
.auth-strength-bar.s-strong { background: var(--auth-success); }
.auth-strength-text {
    font-size: 11px;
    color: var(--auth-muted);
    font-weight: 500;
    min-height: 14px;
    font-family: 'DM Sans', sans-serif;
}

/* Password match warning */
.auth-pw-warning {
    display: none;
    color: var(--auth-error);
    font-size: 12px;
    margin-top: 8px;
    font-family: 'DM Sans', sans-serif;
}
.auth-pw-warning.show { display: block; }

/* Step 3 — review box */
.auth-review-box {
    background: var(--auth-cream);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.auth-review-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin-bottom: 4px;
    font-family: 'DM Sans', sans-serif;
}
.auth-review-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-forest);
    word-break: break-all;
    font-family: 'DM Sans', sans-serif;
}
.auth-review-note {
    font-size: 13.5px;
    color: var(--auth-muted);
    margin-top: 14px;
    line-height: 1.55;
    font-family: 'DM Sans', sans-serif;
}

/* ── External login area ────────────────────────────────── */
.auth-external {
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   RESET Bootstrap interference inside auth-split
   ═══════════════════════════════════════════════════════════ */
.auth-split h1 { margin-bottom: 0; }
.auth-split a  { text-decoration: none; }

/* Hide default Bootstrap form-floating inside auth forms */
.auth-split .form-floating > label { display: none; }

/* Blazor global valid/invalid outlines — suppress inside auth */
.auth-split .valid.modified:not([type=checkbox]) { outline: none; }
.auth-split .invalid { outline: none; }

/* ExternalLoginPicker button(s) */
.auth-split .btn-group,
.auth-split [class*="btn-"] {
    /* let auth button styles take over when auth-btn-* classes are used */
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — hide brand panel on mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .auth-brand { display: none; }
    .auth-form-panel {
        width: 100%;
        padding: 40px 24px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 48px;
    }
    .auth-mobile-logo { display: flex; }
    .auth-form-container { max-width: 100%; }
}

@media (max-width: 480px) {
    .auth-form-panel { padding: 32px 18px; }
    .auth-brand-headline { font-size: 32px; }
    .auth-tabs { margin-bottom: 22px; }
}
