/* YourLavaan Billing UI — Modern SaaS / FinTech Theme with Shimmer & Ajax Motion */
:root {
  --bg-canvas: #f6f7fb;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f3f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --accent-soft: rgba(225, 29, 72, 0.10);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --border: #e2e8f0;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 50px -18px rgba(15, 23, 42, 0.16);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top right, #ffe4e6 0%, transparent 36%),
              radial-gradient(circle at bottom left, #e0e7ff 0%, transparent 40%),
              var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Top AJAX Progress Bar */
.ajax-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #fb7185, #6366f1);
  z-index: 9999;
  opacity: 0;
  transition: width 0.35s var(--ease-spring), opacity 0.25s ease;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.45);
}
.ajax-progress-bar.is-active { opacity: 1; }

/* Animations */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmerMove {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulseRing {
  0% { transform: scale(0.92); opacity: 0.75; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.anim-enter { animation: fadeSlideUp 0.55s var(--ease-spring) both; }
.anim-delay-1 { animation-delay: 0.08s; }
.anim-delay-2 { animation-delay: 0.16s; }

/* Shimmer Skeletons */
.shimmer {
  background: linear-gradient(90deg, #eef2f6 25%, #f8fafc 50%, #eef2f6 75%);
  background-size: 200% 100%;
  animation: shimmerMove 1.4s infinite linear;
  border-radius: 8px;
}
.shimmer-line { height: 14px; margin-bottom: 10px; }
.shimmer-line.sm { width: 45%; }
.shimmer-line.md { width: 70%; }
.shimmer-line.lg { width: 92%; }
.shimmer-title { height: 28px; width: 55%; margin-bottom: 14px; }
.shimmer-card { height: 160px; border-radius: var(--radius-md); }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(15, 23, 42, 0.15);
  border-top-color: var(--accent);
}

/* Auth / Login Split Layout */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
}
.auth-brand-panel {
  background: linear-gradient(145deg, #111827 0%, #1e293b 55%, #311024 100%);
  color: #ffffff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.28), transparent 70%);
  bottom: -120px;
  right: -100px;
  pointer-events: none;
}
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #fb7185);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.35);
}
.feature-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
  font-size: 14px;
}
.feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 12px #fb7185;
  flex-shrink: 0;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.02em; }
.auth-card p.subtitle { margin: 0 0 24px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

/* Token Verification Overlay */
.token-gate {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(225, 29, 72, 0.2);
  margin-bottom: 20px;
  font-size: 13.5px;
  color: #9f1239;
}
.token-gate.is-visible { display: flex; }

/* Form Controls & Buttons */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
}
.input-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px -6px rgba(225, 29, 72, 0.45);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}
.btn-danger-outline {
  background: var(--bg-surface);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.3);
}
.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-soft);
}

/* Dashboard Shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a, #475569);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.dash-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.dash-header h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.025em; }
.dash-header p { margin: 0; color: var(--text-secondary); font-size: 14.5px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  margin-bottom: 28px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}
.card.plan-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card.plan-card.featured {
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: 0 16px 36px -14px rgba(225, 29, 72, 0.22);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseRing 1.8s infinite ease-out;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--text-secondary); }
.meta-value { font-weight: 600; color: var(--text-primary); }

.price-tag { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 6px; }
.price-tag span { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
td { padding: 13px 12px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
tr:last-child td { border-bottom: none; }

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.is-open { display: flex; opacity: 1; }
.modal-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.25s var(--ease-spring);
}
.modal-backdrop.is-open .modal-box { transform: scale(1); }

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeSlideUp 0.35s var(--ease-spring) both;
}
.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #38bdf8; }

.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert-box.is-visible { display: block; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid rgba(220, 38, 38, 0.25); }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid rgba(2, 132, 199, 0.25); }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
