/* ============================================================
   Break The Circle — Global Stylesheet
   Fonts: DM Sans, DM Serif Display, Hind Siliguri
   Theme: Green ambient glow, dual light/dark
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+Da+2:wght@400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display:ital@0;1&family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* @font-face {
  font-family: 'BTC-BanglaDigits';
  src: local('Baloo Da 2');
  unicode-range: U+09E6-09EF;
  font-weight: 300 700;
  font-display: swap;
} */

/* ── CSS Variables ── */
:root {
  /* Green palette */
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Accent / glow */
  --accent:        #22c55e;
  --accent-dim:    #16a34a;
  --accent-soft:   rgba(34, 197, 94, 0.12);
  --accent-glow:   rgba(34, 197, 94, 0.25);
  --accent-glow-lg:rgba(34, 197, 94, 0.10);

  /* Typography */
  /* --font-sans:   'DM Sans', 'BTC-BanglaDigits', 'Hind Siliguri', sans-serif;
  --font-serif:  'DM Serif Display', 'BTC-BanglaDigits', 'Hind Siliguri', serif;
  --font-bangla: 'BTC-BanglaDigits', 'Hind Siliguri', sans-serif; */

  --font-sans:   'DM Sans', 'Baloo Da 2', sans-serif;
  --font-serif:  'DM Serif Display', 'Baloo Da 2', serif;
  --font-bangla: 'Baloo Da 2', sans-serif;
  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.25s ease;
  --t-slow:   0.4s ease;

  /* Z-index */
  --z-nav:    100;
  --z-modal:  200;
  --z-toast:  300;
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg:           #f8faf9;
  --bg-secondary: #ffffff;
  --bg-card:      #ffffff;
  --bg-input:     #f1f5f2;
  --bg-hover:     #e8f5ed;

  --border:       rgba(0, 0, 0, 0.08);
  --border-focus: var(--accent);

  --text-primary:   #0f1a13;
  --text-secondary: #4b6155;
  --text-muted:     #8aab96;
  --text-inverse:   #ffffff;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 0 3px var(--accent-glow), 0 4px 20px var(--accent-glow);

  --scrollbar-track: #f1f5f2;
  --scrollbar-thumb: #c4d9cb;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg:           #0a0f0c;
  --bg-secondary: #101810;
  --bg-card:      #111a13;
  --bg-input:     #161f18;
  --bg-hover:     #1a2a1d;

  --border:       rgba(255, 255, 255, 0.07);
  --border-focus: var(--accent);

  --text-primary:   #e8f5ed;
  --text-secondary: #8aab96;
  --text-muted:     #4b6155;
  --text-inverse:   #0f1a13;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 0 3px var(--accent-glow), 0 4px 24px var(--accent-glow);

  --scrollbar-track: #101810;
  --scrollbar-thumb: #2a3f2e;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--t-slow), color var(--t-slow);
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.2; }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 600; }

.bn { font-family: var(--font-bangla); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast), opacity var(--t-fast);
}
a:hover { opacity: 0.8; }

/* ── Auth Layout ── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.auth-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* Decorative glow orbs */
.auth-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow-lg) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  pointer-events: none;
}

.auth-left::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow-lg) 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  pointer-events: none;
}

.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
}

.auth-logo {
  display: inline-flex;
  margin-bottom: 48px;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

/* Theme-aware logo display */
.auth-logo .logo-dark { display: none; }
[data-theme="dark"] .auth-logo .logo-light { display: none; }
[data-theme="dark"] .auth-logo .logo-dark { display: block; }

.auth-left-tagline {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.auth-left-tagline span {
  color: var(--accent);
  display: block;
}

.auth-left-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-family: var(--font-bangla);
  margin-bottom: 40px;
}

/* Stat chips on auth left */
.auth-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 0.875rem;
  color: var(--text-primary);
  width: fit-content;
  backdrop-filter: blur(8px);
}

.auth-stat-chip .chip-icon {
  font-size: 1rem;
}

.auth-stat-chip .chip-val {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

/* Decorative grid pattern */
.auth-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  pointer-events: none;
}

/* ── Auth Right (Form Side) ── */
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: var(--bg);
  position: relative;
}

.auth-right-inner {
  width: 100%;
  max-width: 400px;
}

.auth-top-bar {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-normal);
  font-size: 1rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Form Elements ── */
.form-heading {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-subheading {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-family: var(--font-bangla);
  line-height: 1.6;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-bangla);
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color var(--t-fast);
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 42px 12px 42px;
  font-size: 0.93rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-normal), box-shadow var(--t-normal), background var(--t-normal);
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-bangla);
  font-size: 0.88rem;
}

.form-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: var(--shadow-glow);
}

.form-input:focus ~ .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--accent);
}

/* Password toggle button */
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
  font-size: 1rem;
}

.pw-toggle:hover { color: var(--accent); }

/* Error / helper text */
.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 5px;
  display: none;
  font-family: var(--font-bangla);
}

.field-error.visible { display: block; }

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

/* Strength meter */
.strength-meter {
  margin-top: 8px;
  display: none;
}

.strength-meter.visible { display: block; }

.strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background var(--t-normal);
}

.strength-bar.active-weak   { background: #ef4444; }
.strength-bar.active-fair   { background: #f59e0b; }
.strength-bar.active-good   { background: #22c55e; }
.strength-bar.active-strong { background: #16a34a; }

.strength-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-bangla);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--t-normal);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn:active::after { opacity: 0.08; }

.btn-primary {
  background: var(--green-600);
  color: #ffffff !important;
  padding: 13px 24px;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--green-700);
  box-shadow: 0 6px 28px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner inside button */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.loading .btn-spinner { display: block; }
.btn.loading .btn-label { display: none; }

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

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

/* ── Switch link ── */
.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: var(--font-bangla);
}

.auth-switch a {
  font-weight: 600;
  color: var(--accent);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-bangla);
  min-width: 260px;
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }

.toast.success { border-left: 3px solid var(--accent); }
.toast.success .toast-icon { color: var(--accent); }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.error   .toast-icon { color: #ef4444; }
.toast.info    { border-left: 3px solid #3b82f6; }
.toast.info    .toast-icon { color: #3b82f6; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Step indicator (Join page) ── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all var(--t-normal);
  flex-shrink: 0;
}

.step.active .step-circle {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.step.done .step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-bangla);
  white-space: nowrap;
  display: none;
}

.step.active .step-label { color: var(--accent); display: block; }
.step.done  .step-label  { color: var(--text-secondary); display: block; }

.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  transition: background var(--t-normal);
  margin: 0 4px;
}

.step-line.done { background: var(--accent); }

/* ── Checkbox ── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-bangla);
  line-height: 1.5;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

/* ── Forgot password link ── */
.forgot-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  display: block;
  margin-top: 4px;
  transition: color var(--t-fast);
  font-family: var(--font-bangla);
}

.forgot-link:hover { color: var(--accent); opacity: 1; }

/* ── Success screen (email verification) ── */
.success-screen {
  text-align: center;
  padding: 16px 0;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 24px;
  border: 2px solid rgba(34,197,94,0.2);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.success-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-family: var(--font-bangla);
  line-height: 1.7;
  margin-bottom: 28px;
}

.success-desc strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.45s ease forwards;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.30s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-left {
    display: none;
  }

  .auth-right {
    padding: 24px 20px;
    justify-content: flex-start;
    padding-top: 72px;
  }

  .auth-right-inner {
    max-width: 100%;
  }

  .auth-top-bar {
    top: 16px;
    right: 16px;
  }

  /* Show a minimal logo on mobile */
  .mobile-logo {
    display: flex !important;
    margin-bottom: 32px;
  }
}

@media (min-width: 769px) {
  .mobile-logo { display: none !important; }
}

/* ── Misc helpers ── */
.tg-input-wrap {
  display: flex;
  align-items: center;
}

.tg-prefix {
  position: absolute;
  left: 40px;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
  z-index: 1;
}

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
