/* ─── Variables & Tokens (Premium Light Silver Ocean Blue Theme) ─── */
:root {
  --bg: #f1f3f9;        /* Premium light silver-gray */
  --bg-2: #e2e8f0;
  --bg-card: #ffffff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(248, 250, 252, 0.75);
  --surface-3: rgba(255, 255, 255, 0.95);
  --border: rgba(148, 163, 184, 0.15); /* Very soft slate */
  --border-strong: rgba(37, 99, 235, 0.25); /* Soft Royal Blue border */
  --text: #0f172a;      /* Deep Slate 900 */
  --text-dim: #475569;  /* Slate 600 */
  --muted: #64748b;     /* Slate 500 */
  --muted-2: #94a3b8;   /* Slate 400 */
  
  --primary: #2563eb;   /* Royal Blue 600 */
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;    /* Sky Blue 500 */
  --accent-hover: #0284c7;
  --warning: #f59e0b;   /* Amber 500 */
  --warning-hover: #d97706;
  --success: #10b981;   /* Emerald 500 */
  --success-hover: #059669;
  --danger: #ef4444;    /* Red 500 */
  
  --grad: linear-gradient(135deg, #0ea5e9 0%, #2563eb 50%, #4f46e5 100%);
  --grad-hover: linear-gradient(135deg, #38bdf8 0%, #1d4ed8 50%, #4338ca 100%);
  --shadow-soft: 
    0 1px 2px rgba(0,0,0,0.015),
    0 8px 30px rgba(148, 163, 184, 0.08),
    0 1px 1px rgba(255, 255, 255, 0.8) inset;
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);
  --shadow-card: 
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 12px 40px rgba(100, 116, 139, 0.05);
    
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Basic Resets ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
}

body {
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  background: rgba(37, 99, 235, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: #2563eb;
}

/* ─── Background Decoration ───────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.18;
  animation: floatOrb 22s ease-in-out infinite;
  will-change: transform;
}

.orb-primary {
  top: -250px;
  left: -150px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
}

.orb-secondary {
  top: 30%;
  right: -250px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
  animation-delay: -7s;
}

.orb-accent {
  bottom: -200px;
  left: 25%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  animation-delay: -14s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -20px, 0) scale(1.04); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
}

/* ─── Layout ──────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  background: rgba(241, 243, 249, 0.85);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.25);
  font-size: 16px;
}

.brand-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.02em;
}

.nav a {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}

.nav a:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.1);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  position: relative;
}

/* ─── Hero Section ────────────────────────────────────── */
.hero {
  padding: 10px 8px 24px;
  text-align: center;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  color: var(--primary);
  margin-bottom: 16px;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 2s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.65; }
}

.hero-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  margin: 12px auto 0;
  font-size: 15px;
  color: var(--text-dim);
  max-width: 580px;
  line-height: 1.6;
}

/* ─── Dashboard Grid ──────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  align-items: start;
  margin-top: 12px;
  animation: fadeUp 0.7s var(--ease) both;
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbars */
.dashboard-right::-webkit-scrollbar,
.input-wrap textarea::-webkit-scrollbar,
.mail-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dashboard-right::-webkit-scrollbar-track,
.input-wrap textarea::-webkit-scrollbar-track,
.mail-body::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-right::-webkit-scrollbar-thumb,
.input-wrap textarea::-webkit-scrollbar-thumb,
.mail-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 99px;
}

.dashboard-right::-webkit-scrollbar-thumb:hover,
.input-wrap textarea::-webkit-scrollbar-thumb:hover,
.mail-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ─── Cards & Panels ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, transparent 40%, transparent 60%, rgba(14, 165, 233, 0.02) 100%);
}

.panel-head {
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  font-family: "Plus Jakarta Sans", sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.panel-head .num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  padding: 2px 6px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.05);
}

.panel-head .sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
}

/* ─── Form Inputs ─────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.field-label {
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.input-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: all 0.25s var(--ease);
}

.input-wrap:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  font-family: inherit;
  transition: all 0.25s var(--ease);
  border-radius: var(--radius-sm);
}

.input-wrap textarea {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  min-height: 120px;
  resize: vertical;
}

.input-wrap select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.form-row-2 .field {
  margin-bottom: 0;
}

.input-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: -1;
  filter: blur(8px);
}

.input-wrap:focus-within .input-glow {
  opacity: 0.1;
}

/* ─── Buttons ─────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 11px 22px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease);
  position: relative;
}

.btn-arrow {
  transition: transform 0.2s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.btn.primary {
  color: #ffffff;
  background: var(--grad);
  background-size: 200% 200%;
  box-shadow: 0 4px 15px -4px rgba(37, 99, 235, 0.4), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  animation: animateGrad 5s linear infinite;
}

@keyframes animateGrad {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -4px rgba(37, 99, 235, 0.5), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

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

.btn.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  animation: none;
}

.btn.ghost {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ─── Alerts & Status Bar ──────────────────────────────── */
.alert {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.3s var(--ease);
}

.alert.error {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.2);
  color: #991b1b;
}

.alert.success {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
  color: #065f46;
}

.mbx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  animation: fadeUp 0.35s var(--ease) both;
}

.mbx-bar .lbl {
  color: var(--muted);
}

.mbx-bar .val {
  color: var(--accent-hover);
  font-family: "JetBrains Mono", monospace;
}

/* ─── Email List & Cards ───────────────────────────────── */
.mail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.4s var(--ease) both;
}

.mail-card:hover {
  border-color: var(--border-strong);
  background: rgba(248, 250, 252, 0.85);
  transform: translateY(-1px);
}

.mail-card.expanded {
  border-color: var(--primary);
  background: #ffffff;
}

.mail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.mail-from {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  word-break: break-all;
  flex: 1;
}

.mail-date {
  color: var(--muted);
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  flex-shrink: 0;
}

.mail-subject {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

.mail-otp {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 113, 133, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #b45309;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.mail-otp:hover {
  transform: scale(1.05);
  border-color: rgba(251, 191, 36, 0.8);
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.15);
}

.mail-body {
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #334155;
  max-height: 450px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  animation: slideDown 0.3s var(--ease) both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
  font-size: 14.5px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.empty-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.7;
}

/* ─── FAQ Accordion ───────────────────────────────────── */
.faq-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(160%);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.faq details {
  border-top: 1px solid var(--border);
  transition: background 0.25s var(--ease);
}

.faq details:first-of-type {
  border-top: 0;
}

.faq details[open] {
  background: rgba(37, 99, 235, 0.03);
}

.faq summary {
  cursor: pointer;
  padding: 14px 20px;
  color: var(--text-dim);
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13.5px;
  outline: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
  user-select: none;
  transition: color 0.2s var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  color: var(--text);
}

.caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
  margin-right: 4px;
}

.faq details[open] .caret {
  transform: rotate(-135deg);
  border-color: var(--primary);
}

.faq p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
  padding: 0 20px 16px;
}

/* ─── Footer ──────────────────────────────────────────── */
.foot {
  padding: 48px 24px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.foot-line.dim {
  opacity: 0.65;
  font-size: 11px;
  margin-top: 4px;
}

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

/* ─── Responsive Adjustments ──────────────────────────── */
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .dashboard-right {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  .container {
    padding: 24px 16px 48px;
  }
  .hero-title {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }
  .brand-text {
    font-size: 15px;
  }
  .nav {
    display: none;
  }
}

/* ─── Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .orb {
    animation: none;
  }
}
