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

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

/* ═══════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════ */

:root {
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --bg-input: #F7F7F5;
  --bg-surface: #F0EFED;
  --border: rgba(0,0,0,0.07);
  --border-mid: rgba(0,0,0,0.1);
  --text: #1A1A1A;
  --text-secondary: #AAAAAA;
  --text-muted: #CCCCCC;
  --gray: #8A8A8A;
  --error: #ff4444;
  --success: #43e97b;

  --aurora-1: #4facfe;
  --aurora-2: #00f2fe;
  --aurora-3: #43e97b;
  --aurora-4: #a18cd1;
  --aurora-5: #fbc2eb;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-card: #1C1C1A;
  --bg-input: #111110;
  --bg-surface: #242422;
  --border: rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.1);
  --text: #F5F5F5;
  --text-secondary: #555555;
  --text-muted: #444444;
  --gray: #888888;
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

/* ═══════════════════════════════════════════
   AURORA ANIMATION
═══════════════════════════════════════════ */

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

.aurora-text {
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-5), var(--aurora-1));
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: aurora 4s ease infinite;
}

.aurora-bg {
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-5), var(--aurora-1));
  background-size: 400% 400%;
  animation: aurora 4s ease infinite;
}

.aurora-border { position: relative; }
.aurora-border::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-5), var(--aurora-1));
  background-size: 400% 400%;
  animation: aurora 4s ease infinite;
  z-index: -1;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; border: none; border-radius: var(--radius-md);
  font-family: 'Inter', inherit; font-size: 13px; font-weight: 600;
  letter-spacing: 0.05em; padding: 14px; cursor: pointer;
  text-decoration: none; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-aurora {
  color: #fff;
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-5), var(--aurora-1));
  background-size: 400% 400%;
  animation: aurora 4s ease infinite;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 0.5px solid var(--border-mid);
}
.btn-outline:hover { color: var(--text); border-color: var(--gray); }

.btn-danger {
  background: rgba(255,68,68,0.06); color: var(--error);
  border: 0.5px solid rgba(255,68,68,0.25);
}

.btn-google {
  background: transparent; color: var(--text);
  border: 0.5px solid var(--border-mid);
  gap: 10px;
}

/* ═══════════════════════════════════════════
   INPUTS
═══════════════════════════════════════════ */

input, textarea {
  width: 100%; background: var(--bg-input);
  border: 0.5px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-family: inherit; font-size: 15px;
  padding: 13px 14px; outline: none;
  transition: border-color 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus { border-color: var(--aurora-1); }

/* Google-style underline field */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary);
}
.field-input {
  background: transparent; border: none;
  border-bottom: 0.5px solid var(--border-mid);
  border-radius: 0; padding: 8px 0;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.field-input:focus { border-bottom-color: var(--aurora-1); }

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */

.card {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}

/* ═══════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════ */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; color: var(--text); }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--gray); }

.back-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; font-size: 18px; text-decoration: none;
}

/* ═══════════════════════════════════════════
   SECTION / ROW
═══════════════════════════════════════════ */

.section-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); padding: 12px 1.25rem 8px;
}

.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 1.25rem; border-top: 0.5px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.row:first-child { border-top: none; }
.row:hover { background: var(--bg-surface); }
.row-left { display: flex; align-items: center; gap: 12px; }
.row-icon { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; }
.row-label { font-size: 14px; color: var(--text); }
.row-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.row-chevron { font-size: 18px; color: var(--text-muted); }
.row.danger .row-label { color: var(--error); }
.row.danger .row-chevron { color: var(--error); }
.row.danger .row-icon { color: var(--error); }

/* ═══════════════════════════════════════════
   TOGGLE
═══════════════════════════════════════════ */

.toggle {
  width: 44px; height: 26px; border-radius: 99px;
  background: var(--bg-surface); position: relative;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
  border: 0.5px solid var(--border);
}
.toggle.on {
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-3));
  background-size: 200% 200%; animation: aurora 4s ease infinite;
  border-color: transparent;
}
.toggle-dot {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on .toggle-dot { left: 20px; }

/* ═══════════════════════════════════════════
   BOTTOM SHEET
═══════════════════════════════════════════ */

.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 100;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  width: 100%; background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 0.5px solid var(--border);
  transform: translateY(100%); transition: transform 0.3s ease;
  max-height: 85vh; overflow-y: auto;
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 99px;
  background: var(--border-mid); margin: 1rem auto 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card);
}
.sheet-title { font-size: 16px; font-weight: 600; color: var(--text); }
.sheet-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer; font-size: 14px;
}
.sheet-body { padding: 1.25rem 1.5rem 2.5rem; display: flex; flex-direction: column; gap: 12px; }

/* ═══════════════════════════════════════════
   AVATAR / PLAN BADGE
═══════════════════════════════════════════ */

.avatar {
  border-radius: 50%;
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-3), var(--aurora-4), var(--aurora-5), var(--aurora-1));
  background-size: 300% 300%; animation: aurora 4s ease infinite;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; flex-shrink: 0;
}

.plan-badge {
  font-size: 11px; color: #fff; padding: 2px 10px;
  border-radius: 20px; display: inline-block;
  background: linear-gradient(270deg, var(--aurora-1), var(--aurora-3), var(--aurora-4));
  background-size: 200% 200%; animation: aurora 4s ease infinite;
}

/* ═══════════════════════════════════════════
   MISC UI
═══════════════════════════════════════════ */

.divider { height: 0.5px; background: var(--border); margin: 0; }

.error-msg { color: var(--error); font-size: 12px; display: none; }
.error-msg.show { display: block; }

.warn-block {
  background: rgba(255,68,68,0.06); border: 0.5px solid rgba(255,68,68,0.15);
  border-radius: var(--radius-md); padding: 12px 14px;
  font-size: 13px; color: rgba(255,100,100,0.9); line-height: 1.6;
}

.progress-line {
  position: fixed; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--border); z-index: 10;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--aurora-1), var(--aurora-3));
  transition: width 0.4s ease;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }

/* ═══════════════════════════════════════════
   UTILS
═══════════════════════════════════════════ */

.page { min-height: 100vh; }
.content { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════
   LEGAL PAGES
═══════════════════════════════════════════ */

.legal-wrap { max-width: 720px; margin: 0 auto; padding: 0 1.5rem 6rem; }
.legal-topbar { position: sticky; top: 0; background: var(--bg); z-index: 10; border-bottom: 0.5px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 1.25rem 0; margin-bottom: 2rem; }
.l-back { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0.5px solid var(--border); background: var(--bg-card); display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 18px; text-decoration: none; flex-shrink: 0; }
.l-logo { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; color: var(--text); text-decoration: none; }
.l-sep { width: 0.5px; height: 16px; background: var(--border); }
.l-title { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--text); }
.docs-nav { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; }
.docs-nav-hdr { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); padding: 12px 1.25rem 8px; }
.docs-nav a { display: flex; align-items: center; justify-content: space-between; padding: 12px 1.25rem; border-top: 0.5px solid var(--border); text-decoration: none; transition: background 0.15s; }
.docs-nav a:first-of-type { border-top: none; }
.docs-nav a:hover { background: var(--bg-surface); }
.docs-nav a span:first-child { font-size: 14px; color: var(--text); }
.docs-nav a span:last-child { color: var(--text-muted); }
.docs-nav a.cur span:first-child { color: var(--aurora-1); font-weight: 500; }
.legal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 1.75rem; }
.legal-body h1 { font-size: 20px; font-weight: 600; color: var(--text); margin: 2rem 0 0.75rem; line-height: 1.3; }
.legal-body h2 { font-size: 15px; font-weight: 600; color: var(--text); margin: 1.75rem 0 0.5rem; }
.legal-body h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 1.25rem 0 0.5rem; }
.legal-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 0.75rem; }
.legal-body ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.legal-body li { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 0.2rem; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body a { color: var(--aurora-1); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.legal-divider { height: 0.5px; background: var(--border); margin: 1.5rem 0; }
.legal-warn { background: rgba(255,68,68,0.06); border: 0.5px solid rgba(255,68,68,0.15); border-radius: var(--radius-md); padding: 14px 16px; font-size: 13px; color: rgba(220,80,80,0.95); line-height: 1.7; margin-bottom: 1.5rem; }
.legal-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 0.5px solid var(--border); font-size: 12px; color: var(--text-muted); line-height: 1.8; }

/* ═══════════════════════════════════════════
   UNIVERSAL MODAL SYSTEM
═══════════════════════════════════════════ */

.mindset-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.mindset-modal-overlay.open { opacity: 1; pointer-events: all; }
.mindset-modal {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  width: 100%; max-width: 100%;
  max-height: 95vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}
.mindset-modal-overlay.open .mindset-modal { transform: translateY(0); }

/* ═══════════════════════════════════════════
   RESPONSIVE SYSTEM
   mobile:  <768px  — fullscreen / bottom sheets
   tablet:  768–1024px — centered modals
   desktop: >1024px — wider layouts
═══════════════════════════════════════════ */

/* Tablet+ — modal */
@media (min-width: 768px) {
  .mindset-modal-overlay { align-items: center; padding: 1.5rem; }
  .mindset-modal {
    border-radius: var(--radius-xl);
    max-width: 680px; max-height: 88vh;
    transform: scale(0.96) translateY(8px);
  }
  .mindset-modal-overlay.open .mindset-modal { transform: scale(1) translateY(0); }
}

/* Desktop — modal */
@media (min-width: 1024px) {
  .mindset-modal { max-width: 760px; }
}

/* Page containers */
@media (min-width: 768px) {
  .page-centered { max-width: 640px; margin: 0 auto; }
  .page-wide { max-width: 900px; margin: 0 auto; }
}

/* Drawer → sidebar on desktop */
@media (min-width: 768px) {
  .drawer-overlay {
    align-items: center; justify-content: flex-start;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  }
  .drawer {
    height: auto !important; max-height: 90vh;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0 !important;
    transform: translateX(-100%) !important;
    width: 300px !important;
    box-shadow: 8px 0 32px rgba(0,0,0,0.12);
  }
  .drawer-overlay.open .drawer { transform: translateX(0) !important; }
}

/* Sheet → centered modal on tablet+ */
@media (min-width: 768px) {
  .sheet-overlay { align-items: center; justify-content: center; padding: 1.5rem; }
  .sheet {
    border-radius: var(--radius-xl) !important;
    max-width: 420px;
    transform: scale(0.96) translateY(8px) !important;
  }
  .sheet-overlay.open .sheet { transform: scale(1) translateY(0) !important; }
  .sheet-handle { display: none; }
}

/* Plans grid */
@media (min-width: 768px) {
  .plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .plans-grid .plan-card { margin-bottom: 0; }
}

/* Profile / Settings / Plans topbars */
@media (min-width: 768px) {
  .profile-topbar, .plans-topbar, .settings-topbar {
    max-width: 640px; margin: 0 auto; border-radius: 0;
  }
  .content { max-width: 640px; margin: 0 auto; width: 100%; }
}

/* Login card */
@media (min-width: 768px) {
  .login-card { max-width: 440px !important; }
  .headline { max-width: 520px !important; }
}

/* Admin panel mobile */
@media (max-width: 767px) {
  .main-area { flex-direction: column !important; }
  .controls-panel {
    width: 100% !important; flex-direction: row !important;
    flex-wrap: wrap; overflow-x: auto;
  }
  .control-card { min-width: 240px; flex: 1; }
}

/* Touch targets */
@media (max-width: 767px) {
  .btn { padding: 15px !important; }
  .row { padding: 15px 1.25rem !important; min-height: 54px; }
  input, textarea { padding: 15px 14px !important; font-size: 16px !important; }
}

/* Legal pages mobile */
@media (max-width: 640px) {
  .legal-wrap { padding: 0 1rem 4rem; }
  .legal-body h1 { font-size: 18px; }
}

/* Safe area — notch / home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sheet-body, .drawer, .screening-modal, .mindset-modal {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  .session-page { padding-bottom: env(safe-area-inset-bottom); }
}
