/* ================================================================
   auth.css — RankPorto Auth Pages
   Luxury/refined aesthetic: dark branding panel + clean form panel
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:         #0A0A0F;
    --brand-mid:     #13131C;
    --brand-border:  rgba(255,255,255,.08);
    --accent:        #7C6AF7;
    --accent-glow:   rgba(124,106,247,.35);
    --accent-light:  rgba(124,106,247,.12);
    --gold:          #C9A96E;
    --gold-light:    rgba(201,169,110,.15);
    --text-inv:      rgba(255,255,255,.92);
    --text-inv-muted:rgba(255,255,255,.45);
    --form-bg:       #FAFAFA;
    --form-card:     #FFFFFF;
    --f-border:      #E4E4E7;
    --f-text:        #18181B;
    --f-muted:       #71717A;
    --f-placeholder: #A1A1AA;
    --f-focus:       #7C6AF7;
    --f-error:       #EF4444;
    --f-success:     #10B981;
    --radius:        14px;
    --radius-sm:     9px;
    --shadow-card:   0 20px 60px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
    --transition:    .2s cubic-bezier(.4,0,.2,1);
    --font-serif:    'Poppins', sans-serif;
    --font-sans:     'Inter', sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Poppins', 'Inter', sans-serif; background: var(--form-bg); color: var(--f-text); line-height: 1.6; min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #6355d4; }

/* ── LAYOUT ── */
.auth-shell {
    display: grid;
    grid-template-columns: 440px 1fr;
    min-height: 100vh;
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand  { display: none; }
}

/* ── BRAND PANEL (left dark) ── */
.auth-brand {
    background: var(--brand);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
}

/* Mesh gradient background */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,106,247,.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(201,169,110,.12) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(124,106,247,.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Subtle grid texture */
.auth-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.brand-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .65rem;
}

.brand-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), #9B8FF8);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 24px var(--accent-glow);
    flex-shrink: 0;
}

.brand-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.brand-logo-icon svg { color: #fff; }

.brand-wordmark {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-inv);
    letter-spacing: -.01em;
}

.brand-body {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-bottom: 1rem;
}

.brand-headline {
    font-family: 'Poppins', sans-serif;
    font-size: 2.1rem;
    line-height: 1.18;
    color: var(--text-inv);
    margin-bottom: 1.1rem;
    letter-spacing: -.02em;
    font-weight: 700;
}

.brand-headline em {
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
}

.brand-tagline {
    font-size: .83rem;
    color: var(--text-inv-muted);
    line-height: 1.65;
    max-width: 300px;
}

.brand-features {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .78rem;
    color: var(--text-inv-muted);
}

.brand-feature-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

.brand-bottom {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--brand-border);
    font-size: .72rem;
    color: var(--text-inv-muted);
}

/* ── FORM PANEL (right) ── */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--form-bg);
    position: relative;
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    animation: slideUp .4s cubic-bezier(.4,0,.2,1) both;
}

@keyframes slideUp {
    from { opacity:0; transform: translateY(18px); }
    to   { opacity:1; transform: translateY(0); }
}

/* Mobile: show logo on top */
.auth-mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-mobile-brand .brand-logo-icon {
    margin: 0 auto .5rem;
}

.auth-mobile-brand .brand-wordmark {
    color: var(--f-text);
    font-size: 1.1rem;
}

@media (max-width: 860px) {
    .auth-mobile-brand { display: block; }
}

/* ── FORM HEADING ── */
.auth-heading { margin-bottom: 1.75rem; }

.auth-heading h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -.025em;
    color: var(--f-text);
    line-height: 1.2;
    margin-bottom: .35rem;
}

.auth-heading p {
    font-size: .83rem;
    color: var(--f-muted);
}

/* ── FORM ELEMENTS ── */
.field { margin-bottom: 1rem; }

.field label {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    color: var(--f-text);
    margin-bottom: .4rem;
    letter-spacing: .01em;
}

.field-input-wrap { position: relative; }

.field input {
    width: 100%;
    padding: .68rem .95rem;
    background: var(--form-card);
    border: 1.5px solid var(--f-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .875rem;
    color: var(--f-text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.field input::placeholder { color: var(--f-placeholder); }

.field input:focus {
    border-color: var(--f-focus);
    box-shadow: 0 0 0 3px rgba(124,106,247,.12);
}

.field input.has-toggle { padding-right: 2.75rem; }

.field-hint {
    font-size: .72rem;
    color: var(--f-muted);
    margin-top: .3rem;
}

/* Password toggle */
.pw-toggle {
    position: absolute;
    right: .8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--f-placeholder);
    padding: .2rem;
    display: flex;
    transition: color var(--transition);
}
.pw-toggle:hover { color: var(--f-muted); }

/* Field row (two columns) */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* Input prefix (phone +) */
.input-prefix-wrap { display: flex; }
.input-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 .75rem;
    background: var(--form-bg);
    border: 1.5px solid var(--f-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .875rem;
    color: var(--f-muted);
    white-space: nowrap;
    user-select: none;
}
.input-prefix-wrap input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── ALERT ── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    animation: slideUp .25s ease both;
}
.auth-alert svg { flex-shrink: 0; margin-top: .05rem; }
.auth-alert.error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.auth-alert.success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.auth-alert.info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.auth-alert.warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* ── BUTTONS ── */
.btn-primary {
    width: 100%;
    padding: .75rem 1.25rem;
    background: var(--f-text);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-decoration: none;
}
.btn-primary:hover {
    background: #27272A;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.btn-primary:active { transform: translateY(0); }

.btn-google {
    width: 100%;
    padding: .72rem 1.25rem;
    background: var(--form-card);
    color: var(--f-text);
    border: 1.5px solid var(--f-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    text-decoration: none;
}
.btn-google:hover {
    border-color: #C4C4C8;
    background: #FAFAFA;
    color: var(--f-text);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transform: translateY(-1px);
}

.btn-secondary-link {
    display: block;
    width: 100%;
    padding: .72rem 1.25rem;
    text-align: center;
    color: var(--f-muted);
    font-size: .83rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.btn-secondary-link:hover { color: var(--f-text); background: var(--f-border); }

/* ── DIVIDER ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.1rem 0;
    color: var(--f-placeholder);
    font-size: .75rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--f-border);
}

/* ── FOOTER LINKS ── */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .78rem;
    color: var(--f-muted);
}
.auth-footer a { color: var(--f-text); font-weight: 500; }
.auth-footer a:hover { color: var(--accent); }

/* ── PASSWORD STRENGTH ── */
.pw-strength { margin-top: .4rem; }
.pw-strength-bar {
    height: 3px;
    border-radius: 99px;
    background: var(--f-border);
    overflow: hidden;
    margin-bottom: .3rem;
}
.pw-strength-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .3s ease, background .3s ease;
    width: 0%;
}
.pw-strength-label { font-size: .7rem; color: var(--f-muted); }

/* ── SUCCESS STATE ── */
.auth-success-icon {
    width: 56px; height: 56px;
    background: #F0FDF4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    border: 1px solid #BBF7D0;
}

/* ── LINK ROW (forgot password) ── */
.field-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}
.field-link-row label { margin-bottom: 0; }
.field-link-row a { font-size: .75rem; color: var(--f-muted); }
.field-link-row a:hover { color: var(--f-text); }

/* ── TERMS TEXT ── */
.auth-terms {
    font-size: .71rem;
    color: var(--f-placeholder);
    text-align: center;
    margin-top: .85rem;
    line-height: 1.6;
}
.auth-terms a { color: var(--f-muted); text-decoration: underline; }
