@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Auth & guest pages — aligned with dashboard-redesign tokens
   Covers: login, register, otp-form, verify-otp, landing,
           show-verification-message, index
   Design tokens live on body.ch-auth-shell so modals inherit them.
   ============================================================ */

body.ch-auth-shell {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --surface-3: #e7e8eb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --accent: #6366f1;
  --accent-h: #4f52e3;
  --accent-soft: rgba(99, 102, 241, 0.10);
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --danger: #dc2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 10px rgba(15, 23, 42, 0.06);
  --ch-brand-primary: var(--accent);
  --ch-brand-primary-hover: var(--accent-h);
  --ch-success: var(--success);
  --ch-danger: var(--danger);
  --ch-dark: var(--text);
  --ch-text: var(--text-2);

  background: var(--bg) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ch-auth-shell .header-navbar-shadow,
body.ch-auth-shell .content-overlay {
  display: none !important;
}

body.ch-auth-shell .app-content.content {
  background: transparent !important;
  min-height: 100vh;
}

body.ch-auth-shell .content-wrapper,
body.ch-auth-shell .content-body {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Bootstrap modals (e.g. password reset on login) */
body.ch-auth-shell .modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

body.ch-auth-shell .modal-header,
body.ch-auth-shell .modal-footer {
  border-color: var(--border);
}

body.ch-auth-shell .modal-title {
  color: var(--text);
  font-weight: 600;
}

body.ch-auth-shell .modal-body {
  color: var(--text-2);
}

body.ch-auth-shell .btn-close {
  filter: none;
  opacity: 0.55;
}

/* ── Page shell ─────────────────────────────────────────── */
.ch-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.ch-auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* ── Card ───────────────────────────────────────────────── */
.ch-auth-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: ch-auth-fadein 0.35s ease both;
}

.ch-auth-card--wide {
  max-width: 520px;
}

@keyframes ch-auth-fadein {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Card header ──────────────────────────────────────────── */
.ch-auth-header {
  background: var(--surface-2);
  padding: 2rem 2rem 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.ch-auth-header::before,
.ch-auth-header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  background: var(--accent);
  pointer-events: none;
}

.ch-auth-header::before {
  width: 180px;
  height: 180px;
  top: -70px;
  right: -50px;
}

.ch-auth-header::after {
  width: 120px;
  height: 120px;
  bottom: -50px;
  left: -40px;
}

.ch-auth-logo {
  width: 64px;
  height: 64px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.ch-auth-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ch-auth-header__title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.ch-auth-header__sub {
  color: var(--text-3);
  font-size: 0.8125rem;
  margin: 0;
  line-height: 1.5;
}

.ch-auth-networks {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.ch-auth-networks img {
  width: 52px;
  height: 36px;
  object-fit: contain;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
}

/* ── Card body ───────────────────────────────────────────── */
.ch-auth-body {
  padding: 1.75rem 2rem 2rem;
}

.ch-auth-muted {
  color: var(--text-3);
  font-size: 0.875rem;
}

.ch-auth-hint {
  font-size: 0.75rem;
  color: var(--text-4);
  margin-top: 4px;
  display: block;
}

/* ── Form ────────────────────────────────────────────────── */
.ch-auth-field {
  margin-bottom: 1.125rem;
}

.ch-auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.ch-auth-input {
  width: 100%;
  height: 44px;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
  font-family: inherit;
}

.ch-auth-input::placeholder {
  color: var(--text-4);
}

.ch-auth-input:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ch-auth-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.ch-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ch-auth-input-wrap .ch-auth-input {
  padding-right: 2.75rem;
}

.ch-auth-input-wrap__toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-4);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.ch-auth-input-wrap__toggle:hover {
  color: var(--accent);
}

.ch-auth-input-wrap__toggle svg {
  width: 16px;
  height: 16px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ch-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 46px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  letter-spacing: 0.01em;
  margin-top: 0.25rem;
  text-decoration: none;
}

.ch-auth-btn:hover:not(:disabled) {
  background: var(--accent-h);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.ch-auth-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.ch-auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ch-auth-btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  margin-top: 0.625rem;
}

.ch-auth-btn--secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: none;
  color: var(--accent);
}

.ch-auth-btn--outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.ch-auth-btn--outline:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: none;
}

.ch-auth-btn--centered {
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.ch-auth-header .ch-auth-btn--outline,
.ch-landing-cta .ch-auth-btn--outline {
  border-color: var(--border-strong);
  color: var(--text);
}

.ch-auth-header .ch-auth-btn--outline:hover:not(:disabled),
.ch-landing-cta .ch-auth-btn--outline:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-3);
}

.ch-auth-btn .ch-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ch-spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}

.ch-auth-btn.is-loading .ch-btn-spinner {
  display: block;
}

.ch-auth-btn.is-loading .ch-btn-text {
  visibility: hidden;
}

.ch-auth-btn.is-loading {
  position: relative;
  pointer-events: none;
}

.ch-auth-btn.is-loading .ch-btn-spinner {
  position: absolute;
  display: block;
}

@keyframes ch-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Divider ────────────────────────────────────────────── */
.ch-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-4);
  font-size: 0.75rem;
}

.ch-auth-divider::before,
.ch-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Footer links ────────────────────────────────────────── */
.ch-auth-footer {
  text-align: center;
  margin-top: 1.25rem;
}

.ch-auth-footer p {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin: 0 0 0.5rem;
}

.ch-auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.ch-auth-footer a:hover {
  text-decoration: underline;
}

/* ── Contact pill ────────────────────────────────────────── */
.ch-auth-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.ch-auth-contact:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text);
}

.ch-auth-contact svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── OTP inputs ─────────────────────────────────────────── */
.ch-otp-group {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin: 1rem 0;
}

.ch-otp-input {
  width: 50px;
  height: 56px;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: 'JetBrains Mono', monospace;
}

.ch-otp-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface-3);
}

.ch-otp-input.filled {
  border-color: var(--success);
  background: var(--success-soft);
}

.ch-otp-resend {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 0.75rem;
}

.ch-otp-resend__timer {
  font-weight: 600;
  color: var(--accent);
}

.ch-otp-resend__link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ch-otp-resend__link:hover {
  text-decoration: underline;
}

/* ── Info block ──────────────────────────────────────────── */
.ch-auth-info-block {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.125rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.ch-auth-info-block svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.ch-auth-info-block p {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin: 0;
  line-height: 1.55;
}

/* ── Package accordion (login) ───────────────────────────── */
.ch-auth-divider-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  text-align: center;
  margin: 1.5rem 0 1rem;
}

.ch-pkg-accordion {
  border-top: 1px solid var(--border);
}

.ch-pkg-accordion-item {
  border-bottom: 1px solid var(--border);
}

.ch-pkg-accordion-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}

.ch-pkg-accordion-btn img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ch-pkg-accordion-btn svg {
  width: 14px;
  height: 14px;
  color: var(--text-4);
  margin-left: auto;
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.ch-pkg-accordion-btn[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.ch-pkg-accordion-body {
  display: none;
  padding-bottom: 0.75rem;
}

.ch-pkg-accordion-body.show {
  display: block;
}

.ch-pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ch-pkg-table th {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.ch-pkg-table td {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

.ch-pkg-table tr:hover td {
  background: var(--surface-2);
}

.ch-pkg-vol {
  font-weight: 700;
  color: var(--text);
}

.ch-pkg-price {
  font-weight: 600;
  color: var(--accent);
}

.ch-pkg-desc {
  color: var(--text-3);
  font-size: 0.75rem;
}

/* ── Landing ─────────────────────────────────────────────── */
.ch-landing-card {
  max-width: 420px;
}

.ch-landing-cta {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.ch-landing-cta .ch-auth-btn {
  width: auto;
  padding: 0 1.75rem;
  flex: 1;
}

.ch-landing-stats {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.ch-landing-stat {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem 0.875rem;
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 600;
}

/* ── Verification message ─────────────────────────────────── */
.ch-verify-icon {
  width: 72px;
  height: 72px;
  background: var(--success-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.ch-verify-icon svg {
  width: 36px;
  height: 36px;
  color: var(--success);
}

.ch-verify-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.625rem;
}

.ch-verify-text {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* ── Step indicator ─────────────────────────────────────── */
.ch-auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.ch-auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ch-auth-step__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-4);
  transition: all 0.22s;
}

.ch-auth-step--done .ch-auth-step__dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.ch-auth-step--active .ch-auth-step__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ch-auth-step__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-4);
}

.ch-auth-step--active .ch-auth-step__label,
.ch-auth-step--done .ch-auth-step__label {
  color: var(--text-2);
}

.ch-auth-step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 18px;
}

.ch-auth-step-line--done {
  background: var(--success);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .ch-auth-body {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .ch-auth-header {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .ch-otp-input {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }
}
