/* =========================================================
   PrintBull — Auth pages (login / register / profile)
   Premium split-screen (home.css bilan bir xil tilda)
   ========================================================= */

/* Token'lar home.css dan keladi (links: home.css avval yuklanmaydi shu sahifalarda).
   Shuning uchun bu yerda qisqa qayta belgilanadi. */
:root {
  /* Brand + neytral (printbull_design_system.md) */
  --brand: #E5142B;  --brand-hover: #C70F23;  --brand-active: #A30C1C;
  --brand-soft: #FFF1F1;  --on-brand: #FFFFFF;
  --bg: #FBF8F5;  --surface: #FFFFFF;  --surface-2: #F4EFEA;  --border: #E7E0D9;
  --text: #1A1714;  --text-muted: #837A71;
  /* Dark surfaces (aside paneli uchun) */
  --d-bg: #120F0D;  --d-surface: #1A1714;  --d-text: #F7F4F1;  --d-muted: #A9A097;
  --d-border: rgba(255,255,255,.08);
  /* Funksional (holatlar) */
  --success: #16A34A;  --success-soft: #DCFCE7;
  --warning: #F59E0B;  --warning-soft: #FEF3C7;
  --error:   #DC2626;  --error-soft:   #FEE2E2;
  --info:    #2563EB;  --info-soft:    #DBEAFE;
  /* Eski tokenlar → yangi tizimga ulangan */
  --pb-red: var(--brand);  --pb-red-dark: var(--brand-hover);  --pb-red-soft: var(--brand-soft);
  --ink: var(--text);  --ink-2: var(--text-muted);  --gray: var(--text-muted);
  --gray-2: var(--border);  --gray-3: var(--surface-2);  --green: var(--success);  --white: var(--surface);
  --radius-sm: 8px;  --radius-md: 12px;  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* =========================================================
   SPLIT-SCREEN LAYOUT (login / register)
   ========================================================= */
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ─── LEFT: brand showcase ──────────────────────────────── */
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 56px 48px;
  color: var(--d-text);
  /* Qatlamlar (yuqoridan pastga):
     1) qizil glow  2) qorong'i overlay (matn o'qilishi uchun)
     3) SURAT  4) zaxira dark rang (surat bo'lmasa shu ko'rinadi) */
  background:
    radial-gradient(110% 80% at 85% 0%, rgba(229,20,43,.34) 0%, rgba(229,20,43,0) 55%),
    linear-gradient(105deg, rgba(13,11,10,.94) 0%, rgba(13,11,10,.72) 48%, rgba(13,11,10,.46) 100%),
    url('../img/auth/cover.jpg') center / cover no-repeat,
    #120F0D;
}
/* nozik nuqtali tekstura */
.auth-aside::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .3;
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }

.auth-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--d-text);
}
.auth-brand img { height: 30px; width: auto; }

.auth-aside__mid { max-width: 460px; }
.auth-aside__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #FFB3B9;
  padding: 7px 14px;
  border: 1px solid var(--d-border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  margin-bottom: 24px;
}
.auth-aside__title {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 18px;
}
.auth-aside__title b { color: #FF6470; font-weight: 800; }
.auth-aside__text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--d-muted);
  margin-bottom: 36px;
}

/* afzalliklar ro'yxati */
.auth-feats { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.auth-feat { display: flex; align-items: center; gap: 14px; }
.auth-feat__ic {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(229,20,43,.16);
  border: 1px solid rgba(255,100,112,.22);
  color: #FF6470;
}
.auth-feat__ic svg { width: 22px; height: 22px; }
.auth-feat__tx b { display: block; font-size: 15px; font-weight: 700; color: var(--d-text); }
.auth-feat__tx span { font-size: 13px; color: var(--d-muted); }

/* footer statistika */
.auth-aside__foot {
  display: flex; gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--d-border);
}
.auth-stat__num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--d-text); }
.auth-stat__lbl { font-size: 12px; color: var(--d-muted); margin-top: 2px; }

/* ─── RIGHT: form panel ─────────────────────────────────── */
.auth-panel {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
}
.auth-panel__back {
  position: absolute; top: 28px; right: 32px;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .15s ease;
}
.auth-panel__back:hover { color: var(--text); }
.auth-panel__back svg { width: 16px; height: 16px; }

/* mobil uchun logo (aside yashiringanda ko'rinadi) */
.auth-panel__brand {
  display: none;
  align-items: center; gap: 8px;
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--brand);
  margin-bottom: 28px;
}
.auth-panel__brand img { height: 28px; width: auto; }

/* =========================================================
   TOP BAR — faqat profil sahifasi uchun (markazlashgan layout)
   ========================================================= */
.auth-top {
  padding: 20px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.auth-top__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-top__logo { display: flex; align-items: center; gap: 8px; }
.auth-top__logo img { height: 28px; width: auto; }
.auth-top__logo-text { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--brand); }
.auth-top__back {
  font-size: 14px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .15s ease;
}
.auth-top__back:hover { color: var(--text); }
.auth-top__back svg { width: 16px; height: 16px; }

.auth-main {
  min-height: calc(100vh - 69px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}

/* =========================================================
   CARD
   ========================================================= */
.auth-card {
  width: 100%;
  max-width: 420px;
  animation: auth-rise .5s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-card__head { margin-bottom: 28px; }
.auth-card__title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.auth-card__sub {
  font-size: 15px;
  color: var(--text-muted);
}

/* ─── Tabs (Email | Telefon) ────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  border-radius: 999px;
  transition: all .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.auth-tab svg { width: 16px; height: 16px; }

/* ─── Form ──────────────────────────────────────────────── */
.auth-pane { display: none; }
.auth-pane.is-active { display: block; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input[disabled] {
  background: var(--surface-2);
  cursor: not-allowed;
}

/* Code input — center, big, monospace */
.field--code input {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4em;
  font-family: 'SF Mono', Consolas, monospace;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  width: 100%;
  height: 50px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 15px; font-weight: 600;
  border-radius: var(--radius-md);
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease, border-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 2px 8px rgba(229,20,43,.18);
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: 0 6px 18px rgba(229,20,43,.28);
}
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--text);
}
.btn--google {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--google:hover:not(:disabled) { background: var(--surface-2); }
.btn--google svg { width: 20px; height: 20px; }

.btn-spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--on-brand);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Divider "yoki" ────────────────────────────────────── */
.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Footer link (sign in / sign up) ───────────────────── */
.auth-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-foot a {
  color: var(--brand);
  font-weight: 600;
}
.auth-foot a:hover { text-decoration: underline; }

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  line-height: 1.4;
}
.alert.is-shown { display: block; }
.alert--err { background: var(--error-soft); color: var(--error); }
.alert--ok  { background: var(--success-soft); color: var(--success); }
.alert--dev { background: var(--warning-soft); color: var(--warning); border: 1px dashed var(--warning); }

/* ─── Phone code stage hider ────────────────────────────── */
.phone-step-2 { display: none; }
.phone-step-2.is-shown { display: block; }
.phone-step-1.is-hidden { display: none; }

/* =========================================================
   PROFILE
   ========================================================= */
.profile-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 4px 16px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.04);
}
.profile-head {
  display: flex; align-items: center; gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-meta { font-size: 14px; color: var(--text-muted); }
.profile-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 24px;
}
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--surface-2);
}
.profile-row:last-child { border-bottom: none; }
.profile-row__label { color: var(--text-muted); }
.profile-row__value { font-weight: 500; color: var(--text); }
.profile-actions { display: flex; gap: 12px; }
.profile-actions .btn { flex: 1; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 920px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-panel__brand { display: inline-flex; }
  .auth-panel__back { top: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .auth-card, .profile-card {
    max-width: 100%;
  }
  .profile-card { padding: 28px 22px; border-radius: var(--radius-md); }
  .auth-card__title { font-size: 26px; }
  .auth-panel { padding: 72px 18px 32px; }
  .auth-main { padding: 24px 16px; }
  .profile-head { flex-direction: column; text-align: center; gap: 12px; }
  .profile-actions { flex-direction: column; }
}
