/* ===== Design tokens (matched to reference image) ===== */
:root {
  --color-primary: #A30052;
  --color-primary-dark: #8E004B;
  --color-primary-light: #F5E0EC;
  --color-heading: #1A1A4B;
  --color-text: #4A4A68;
  --color-text-muted: #8A8AA3;
  --color-border: #E0E0E0;
  --color-bg: #F4F5F8;
  --color-white: #FFFFFF;
  --color-security-bg: #EEF0F8;
  --color-security-text: #6B7A99;
  --color-icon-bg: #FCE4EF;
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-btn: 10px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== Reset & base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

/* ===== Page layout ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 40px 0;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ===== Main 3-column grid ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  align-items: stretch;
}

/* ===== Promo panel (left) ===== */
.promo-panel {
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-card);
  padding: 32px 28px 28px;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.promo-illustration {
  margin-bottom: 24px;
}

.promo-illustration svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
}

.promo-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.promo-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  opacity: 0.92;
  margin-bottom: auto;
  padding-bottom: 28px;
}

.promo-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
}

.promo-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.95;
}

.promo-feature svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ===== Auth cards ===== */
.auth-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon--register,
.card-icon--login {
  background: var(--color-icon-bg);
  color: var(--color-primary);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ===== Form elements ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}

.input-group input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--color-heading);
  background: var(--color-white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
  color: #B0B0C0;
}

.input-group input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(163, 0, 82, 0.1);
}

.input-group .toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
}

.input-group .toggle-password:hover {
  color: var(--color-primary);
}

.input-group input[type="password"] + .toggle-password ~ input,
.input-group:has(.toggle-password) input {
  padding-right: 44px;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--color-text);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label--inline {
  align-items: center;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-label--inline input[type="checkbox"] {
  margin-top: 0;
}

.checkbox-label a {
  color: var(--color-primary);
}

/* Form options row (login) */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.link-forgot {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Primary button */
.btn-primary {
  width: 100%;
  height: 46px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-primary:active {
  transform: scale(0.99);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0 16px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.divider span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Google button */
.btn-google {
  width: 100%;
  height: 46px;
  background: var(--color-white);
  color: var(--color-heading);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-google:hover {
  background: #FAFAFA;
  border-color: #CCC;
}

/* Card footer */
.card-footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 20px;
}

.card-footer a {
  font-weight: 600;
}

/* ===== Security footer bar ===== */
.security-bar {
  margin-top: 36px;
  margin-left: -40px;
  margin-right: -40px;
  background: var(--color-security-bg);
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--color-security-text);
  font-size: 0.8125rem;
}

.security-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.security-left svg {
  flex-shrink: 0;
  color: var(--color-security-text);
  opacity: 0.8;
}

.security-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.security-right svg {
  color: var(--color-primary);
}

/* ===== Auth split layout (Registration / Login pages) ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
}

.auth-logo:hover { text-decoration: none; }
.auth-logo svg { color: var(--color-primary); }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.auth-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 940px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 40px 48px;
  align-items: center;
}

.auth-split .promo-panel { min-height: 560px; }
.auth-split .auth-card { align-self: stretch; justify-content: center; }

/* ===== Landing page ===== */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.landing-nav-actions { display: flex; align-items: center; gap: 12px; }

.btn-nav-ghost {
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: 1.5px solid transparent;
  text-decoration: none;
}

.btn-nav-ghost:hover { background: var(--color-primary-light); text-decoration: none; }

.btn-nav-primary {
  padding: 9px 20px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-primary);
  border: none;
  text-decoration: none;
}

.btn-nav-primary:hover { background: var(--color-primary-dark); text-decoration: none; }

/* Hero */
.hero {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 48px 64px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.12;
  color: var(--color-heading);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero h1 .accent { color: var(--color-primary); }

.hero p.lead {
  font-size: 1.0625rem;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn-hero-primary:hover { background: var(--color-primary-dark); text-decoration: none; transform: translateY(-1px); }

.btn-hero-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-white);
  color: var(--color-heading);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.1s;
}

.btn-hero-outline:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; transform: translateY(-1px); }

.hero-visual {
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 24px;
  padding: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual svg { width: 100%; max-width: 360px; height: auto; }

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
}

.hero-stat .num { font-size: 1.75rem; font-weight: 700; color: var(--color-primary); }
.hero-stat .lbl { font-size: 0.8125rem; color: var(--color-text-muted); }

/* Features section */
.section {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 48px;
}

.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 1.875rem; font-weight: 700; color: var(--color-heading); margin-bottom: 10px; letter-spacing: -0.01em; }
.section-head p { font-size: 0.9375rem; color: var(--color-text-muted); max-width: 560px; margin: 0 auto; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--color-heading); margin-bottom: 8px; }
.feature-card p { font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.6; }

/* Roles section */
.roles-section { background: var(--color-white); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.role-tile {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
}
.role-tile-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.role-tile h3 { font-size: 1.0625rem; font-weight: 700; color: var(--color-heading); margin-bottom: 8px; }
.role-tile p { font-size: 0.8125rem; color: var(--color-text-muted); line-height: 1.6; }

/* CTA band */
.cta-band {
  max-width: 1240px;
  margin: 0 auto 56px;
  padding: 48px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7B42F6 100%);
  border-radius: 24px;
  text-align: center;
  color: var(--color-white);
}

.cta-band h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 12px; }
.cta-band p { font-size: 0.9375rem; opacity: 0.92; margin-bottom: 26px; }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--color-white);
  color: var(--color-primary);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.btn-cta:hover { text-decoration: none; transform: translateY(-1px); }

/* Landing footer */
.landing-footer {
  background: var(--color-security-bg);
  padding: 28px 48px;
  color: var(--color-security-text);
  font-size: 0.8125rem;
}

.landing-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.landing-footer .sec { display: flex; align-items: center; gap: 8px; }
.landing-footer .sec.brand { font-weight: 700; color: var(--color-heading); }
.landing-footer .sec svg { color: var(--color-primary); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .main-grid {
    grid-template-columns: 1fr 1fr;
  }

  .promo-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .promo-features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { order: -1; }
  .features-grid, .roles-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .page {
    padding: 20px 16px 0;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .security-bar {
    flex-direction: column;
    text-align: center;
    padding: 16px 20px;
    margin-left: -16px;
    margin-right: -16px;
  }

  .security-left {
    flex-direction: column;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .auth-split { grid-template-columns: 1fr; padding: 12px 16px 32px; }
  .auth-split .promo-panel { min-height: auto; }
  .auth-topbar { padding: 16px 20px; }

  .landing-nav { padding: 16px 20px; }
  .hero { padding: 28px 20px 40px; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 40px 20px; }
  .features-grid, .roles-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 24px; margin: 0 16px 40px; }
  .hero-stats { gap: 20px; }
}

/* Forma xabarlari (api/auth.js) */
.auth-msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}
.auth-msg--error {
  background: #FDECEC;
  color: #B42318;
  border: 1px solid #F5C2C0;
}
.auth-msg--warn {
  background: #FFF4E5;
  color: #B45309;
  border: 1px solid #F5D9A8;
}
.auth-msg--ok {
  background: #E8FAEF;
  color: #15803D;
  border: 1px solid #BBE9CB;
}

/* Google bilan kirish — shaffof overlay (custom tugma dizayni saqlanadi) */
.g-wrap { position: relative; }
.g-render {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.g-render > div,
.g-render iframe {
  width: 100% !important;
  height: 100% !important;
  transform: scale(1.4);
}
