/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --green: #10b981;
  --danger: #ef4444;
  --text: #0f172a;
  --text-2: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --radius: 14px;
  --shadow-lg: 0 20px 60px rgba(79,70,229,.15), 0 4px 20px rgba(0,0,0,.08);
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; color: var(--text); line-height: 1.6; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ===== AUTH SPLIT LAYOUT ===== */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* Left panel */
.auth-left { background: linear-gradient(145deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; }
.auth-panel-content { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 3rem; }
.auth-brand-icon { width: 40px; height: 40px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; color: #fff; }
.auth-brand span { font-size: 1.15rem; font-weight: 700; color: #fff; }
.auth-brand strong { color: #a5b4fc; }
.auth-headline { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 1rem; letter-spacing: -.02em; }
.auth-headline em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #6ee7b7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-subtext { color: rgba(255,255,255,.65); font-size: .95rem; max-width: 320px; line-height: 1.7; margin-bottom: 2.5rem; }
.auth-features { display: flex; flex-direction: column; gap: .875rem; }
.auth-feat { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.85); font-size: .875rem; }
.auth-feat-icon { width: 32px; height: 32px; background: rgba(255,255,255,.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feat-icon svg { width: 16px; height: 16px; color: #a5b4fc; }
.auth-panel-footer { position: relative; z-index: 1; }
.auth-testimonial { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 1.25rem; }
.auth-testimonial p { color: rgba(255,255,255,.8); font-size: .83rem; font-style: italic; line-height: 1.6; margin-bottom: .75rem; }
.auth-testi-author { display: flex; align-items: center; gap: .6rem; }
.auth-testi-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: #fff; }
.auth-testi-author strong { display: block; font-size: .78rem; color: #fff; }
.auth-testi-author span { font-size: .7rem; color: rgba(255,255,255,.5); }

/* Right panel */
.auth-right { display: flex; align-items: center; justify-content: center; background: var(--white); padding: 2.5rem; }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-header { margin-bottom: 2rem; }
.auth-form-header h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .4rem; }
.auth-form-header p { color: var(--text-muted); font-size: .9rem; }
.auth-form-header p a { color: var(--primary); font-weight: 600; }
.auth-form-header p a:hover { text-decoration: underline; }

/* Google OAuth Button */
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .85rem; border: 2px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font-size: .95rem; font-weight: 600; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.btn-google:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.btn-google img { width: 20px; height: 20px; }
.btn-google.disabled { opacity: .5; cursor: not-allowed; }
.btn-google-svg { width: 20px; height: 20px; flex-shrink: 0; }

.divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--text-muted); font-size: .8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .83rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: .875rem; width: 17px; height: 17px; color: var(--text-muted); pointer-events: none; flex-shrink: 0; }
.input-wrap input { width: 100%; padding: .78rem .78rem .78rem 2.6rem; border: 2px solid var(--border); border-radius: 10px; font-size: .9rem; color: var(--text); background: #fafafa; outline: none; transition: border-color .2s, box-shadow .2s; font-family: inherit; }
.input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); background: #fff; }
.input-wrap input.error { border-color: var(--danger); }
.toggle-pw { position: absolute; right: .75rem; background: none; border: none; cursor: pointer; color: var(--text-muted); padding: .2rem; display: flex; }
.toggle-pw svg { width: 17px; height: 17px; }

.field-error { font-size: .75rem; color: var(--danger); margin-top: .3rem; display: none; }
.field-error.show { display: block; }

/* Password strength */
.pw-strength { margin-top: .4rem; display: flex; gap: .25rem; }
.pw-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; transition: background .3s; }
.pw-bar.weak { background: var(--danger); }
.pw-bar.fair { background: #f59e0b; }
.pw-bar.good { background: #3b82f6; }
.pw-bar.strong { background: var(--green); }
.pw-label { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }

.form-checkbox { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1.25rem; }
.form-checkbox input[type="checkbox"] { margin-top: .25rem; accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.form-checkbox label { font-size: .82rem; color: var(--text-muted); cursor: pointer; }
.form-checkbox label a { color: var(--primary); font-weight: 600; }

.alert-msg { padding: .75rem 1rem; border-radius: 8px; font-size: .85rem; margin-bottom: 1rem; display: none; }
.alert-msg.show { display: block; }
.alert-msg.error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-msg.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

.btn-submit { width: 100%; padding: .9rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 10px; font-size: .95rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem; transition: transform .15s, box-shadow .15s; font-family: inherit; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79,70,229,.35); }
.btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; box-shadow: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.trial-note { text-align: center; margin-top: 1rem; font-size: .78rem; color: var(--text-muted); }
.trial-note strong { color: var(--text); }

/* ===== ONBOARDING ===== */
.onboarding-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.onboard-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; }
.onboard-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 700; }
.onboard-brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 800; color: #fff; }
.onboard-brand strong { color: var(--primary); }
.onboard-step-indicator { font-size: .82rem; color: var(--text-muted); font-weight: 500; }

.onboard-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1.5rem; }
.onboard-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 580px; overflow: hidden; }

/* Progress steps */
.progress-steps { display: flex; padding: 1.75rem 2rem; border-bottom: 1px solid var(--border); gap: 0; }
.progress-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.progress-step:not(:last-child)::after { content: ''; position: absolute; top: 16px; left: 50%; right: -50%; height: 2px; background: var(--border); z-index: 0; }
.progress-step.done:not(:last-child)::after { background: var(--primary); }
.ps-circle { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--text-muted); z-index: 1; transition: all .3s; }
.progress-step.active .ps-circle { border-color: var(--primary); background: var(--primary); color: #fff; }
.progress-step.done .ps-circle { border-color: var(--primary); background: var(--primary); color: #fff; }
.progress-step.done .ps-circle::after { content: '✓'; }
.progress-step.done .ps-num { display: none; }
.ps-label { font-size: .7rem; font-weight: 600; color: var(--text-muted); margin-top: .4rem; text-align: center; }
.progress-step.active .ps-label { color: var(--primary); }
.progress-step.done .ps-label { color: var(--primary); }

/* Step panels */
.step-panels { padding: 2rem; }
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel-header { margin-bottom: 1.75rem; }
.step-panel-header h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: .4rem; }
.step-panel-header p { font-size: .875rem; color: var(--text-muted); }
.step-panel-header .step-icon-big { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.step-panel-header .step-icon-big svg { width: 26px; height: 26px; color: var(--primary); }

.onboard-form .form-group { margin-bottom: 1.1rem; }
.onboard-form label { display: block; font-size: .83rem; font-weight: 600; color: var(--text-2); margin-bottom: .4rem; }
.onboard-form input, .onboard-form select { width: 100%; padding: .78rem 1rem; border: 2px solid var(--border); border-radius: 10px; font-size: .9rem; color: var(--text); background: #fafafa; outline: none; transition: border-color .2s; font-family: inherit; }
.onboard-form input:focus, .onboard-form select:focus { border-color: var(--primary); background: #fff; }
.onboard-form .input-prefix { display: flex; }
.onboard-form .input-prefix span { padding: .78rem .875rem; background: var(--bg); border: 2px solid var(--border); border-right: none; border-radius: 10px 0 0 10px; font-size: .85rem; color: var(--text-muted); }
.onboard-form .input-prefix input { border-radius: 0 10px 10px 0; }

/* Plan cards */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .875rem; }
.plan-card { border: 2px solid var(--border); border-radius: 12px; padding: 1.25rem 1rem; cursor: pointer; transition: border-color .2s, box-shadow .2s; text-align: center; position: relative; }
.plan-card:hover { border-color: var(--primary); }
.plan-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-light); }
.plan-card input[type="radio"] { position: absolute; opacity: 0; }
.plan-badge { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .2rem .5rem; border-radius: 20px; display: inline-block; margin-bottom: .6rem; }
.plan-badge.trial { background: #d1fae5; color: #065f46; }
.plan-badge.popular { background: var(--primary-light); color: var(--primary); }
.plan-badge.agency { background: #ede9fe; color: #5b21b6; }
.plan-name { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.plan-price { font-size: 1.4rem; font-weight: 900; color: var(--primary); }
.plan-price span { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.plan-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); position: absolute; top: .75rem; right: .75rem; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.plan-card.selected .plan-check { border-color: var(--primary); background: var(--primary); }
.plan-card.selected .plan-check::after { content: '✓'; color: #fff; font-size: .6rem; font-weight: 700; }

/* Step nav */
.step-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.btn-back { display: flex; align-items: center; gap: .4rem; padding: .75rem 1.25rem; border: 2px solid var(--border); background: #fff; color: var(--text-2); border-radius: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; transition: border-color .15s; font-family: inherit; }
.btn-back:hover { border-color: var(--text-muted); }
.btn-back:disabled { opacity: .4; cursor: not-allowed; }
.btn-next { display: flex; align-items: center; gap: .4rem; padding: .75rem 1.75rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 10px; font-size: .875rem; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s; font-family: inherit; }
.btn-next:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,.35); }
.btn-next svg { width: 16px; height: 16px; }

/* Success step */
.success-step { text-align: center; padding: 1rem 0; }
.success-icon { width: 72px; height: 72px; background: #d1fae5; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }
.success-icon svg { width: 36px; height: 36px; color: #059669; }
.success-step h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }
.success-step p { color: var(--text-muted); font-size: .9rem; max-width: 340px; margin: 0 auto 2rem; }
.trial-pill { display: inline-flex; align-items: center; gap: .5rem; background: #d1fae5; color: #065f46; padding: .5rem 1.25rem; border-radius: 20px; font-size: .85rem; font-weight: 600; margin-bottom: 2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 2rem 1.5rem; }
  .plan-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .progress-steps { padding: 1.25rem; }
  .ps-label { display: none; }
  .step-panels { padding: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
}
