/* ═══════════════════════════════════════════════════════
   EverydayAI — Light Mode Consumer Design System
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:         #f8f7ff;
  --surface:    #ffffff;
  --surface-2:  #f1f0fb;
  --border:     #e4e2f5;
  --border-2:   #d0cef0;

  --indigo:     #5b50e8;
  --indigo-h:   #4840d6;
  --indigo-lt:  #ede9ff;
  --indigo-mid: #7b72ee;

  --green:      #16a34a;
  --green-lt:   #dcfce7;
  --amber:      #d97706;
  --amber-lt:   #fef3c7;
  --red:        #dc2626;
  --red-lt:     #fee2e2;

  --text:       #1a1635;
  --text-2:     #4b4778;
  --text-3:     #8580b0;

  --font-h:     'Outfit', sans-serif;
  --font-b:     'Plus Jakarta Sans', sans-serif;

  --radius:     14px;
  --shadow:     0 2px 16px rgba(91,80,232,.08);
  --shadow-lg:  0 8px 40px rgba(91,80,232,.13);
}

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

body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Topnav ── */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.logo { font-family: var(--font-h); font-weight: 800; font-size: 1.4rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--indigo); }
.nav-pills { display: flex; gap: .5rem; }
.nav-pill {
  font-family: var(--font-h); font-weight: 600; font-size: .85rem;
  color: var(--text-2); text-decoration: none;
  padding: .45rem .9rem; border-radius: 8px;
  transition: all .15s;
}
.nav-pill:hover { background: var(--indigo-lt); color: var(--indigo); }
.nav-pill.active { background: var(--indigo-lt); color: var(--indigo); }
.nav-right { display: flex; align-items: center; gap: .75rem; }
.tier-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 99px;
  background: var(--indigo-lt); color: var(--indigo);
  border: 1px solid #c5bff5;
}
.tier-badge.pro { background: var(--green-lt); color: var(--green); border-color: #86efac; }

/* ── Buttons ── */
.btn {
  font-family: var(--font-h); font-weight: 600;
  border: none; cursor: pointer;
  border-radius: 10px; transition: all .18s;
  display: inline-flex; align-items: center; gap: .5rem;
}
.btn-primary {
  background: var(--indigo); color: #fff;
  padding: .75rem 1.6rem; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(91,80,232,.25);
}
.btn-primary:hover:not(:disabled) { background: var(--indigo-h); box-shadow: 0 4px 20px rgba(91,80,232,.4); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline {
  background: transparent; color: var(--indigo);
  border: 1.5px solid var(--indigo); padding: .65rem 1.4rem; font-size: .9rem;
}
.btn-outline:hover { background: var(--indigo-lt); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  padding: .6rem 1rem; font-size: .85rem; border: none;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { padding: .95rem 2.2rem; font-size: 1.05rem; }

/* ── Spinner ── */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth modal ── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,22,53,.45); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal {
  background: var(--surface); border-radius: 20px;
  padding: 2.5rem; width: 420px; max-width: 95vw;
  box-shadow: var(--shadow-lg); position: relative;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(18px); } to { opacity:1; transform: translateY(0); } }
.modal-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-3);
}
.modal-close:hover { color: var(--text); }
.tab-row { display: flex; background: var(--surface-2); border-radius: 10px; padding: .2rem; margin-bottom: 1.75rem; }
.tab {
  flex: 1; background: none; border: none; font-family: var(--font-h); font-weight: 600;
  font-size: .9rem; color: var(--text-3); padding: .55rem; border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.tab.active { background: var(--surface); color: var(--indigo); box-shadow: 0 1px 6px rgba(0,0,0,.08); }

/* ── Forms ── */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: var(--text-2); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: .7rem .9rem; font-family: var(--font-b); font-size: .95rem; color: var(--text);
  background: var(--surface); outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--indigo); }
.field textarea { resize: vertical; min-height: 120px; }
.field .hint { font-size: .75rem; color: var(--text-3); margin-top: .3rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Hero landing ── */
.hero {
  max-width: 900px; margin: 0 auto; padding: 5rem 1.5rem 3rem;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--indigo-lt); color: var(--indigo);
  font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .3rem .9rem; border-radius: 99px; margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--font-h); font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -.03em;
  color: var(--text); margin-bottom: 1.25rem;
}
.hero h1 span { color: var(--indigo); }
.hero p { font-size: 1.15rem; color: var(--text-2); max-width: 580px; margin: 0 auto 2.5rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-sub { font-size: .82rem; color: var(--text-3); }
.tool-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem; max-width: 900px; margin: 4rem auto 0; padding: 0 1.5rem 4rem;
}
.tool-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; text-align: left; cursor: pointer;
  transition: all .2s; box-shadow: var(--shadow);
}
.tool-card:hover { border-color: var(--indigo); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.tool-card h3 { font-family: var(--font-h); font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.tool-card p { font-size: .875rem; color: var(--text-2); line-height: 1.5; }

/* ── Dashboard / App shell ── */
.app-shell { display: flex; min-height: calc(100vh - 57px); }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.sidebar-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: .5rem .75rem .25rem; margin-top: .75rem;
}
.sidebar-label:first-child { margin-top: 0; }
.sidebar a {
  display: flex; align-items: center; gap: .65rem;
  font-size: .9rem; font-weight: 600; color: var(--text-2);
  text-decoration: none; padding: .6rem .75rem; border-radius: 9px; transition: all .15s;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: var(--indigo-lt); color: var(--indigo); }
.sidebar-icon { font-size: 1.1rem; }
.main-content { flex: 1; padding: 2.5rem; max-width: 900px; }

/* ── Usage bar ── */
.usage-bar-wrap { margin-bottom: 2rem; }
.usage-bar-label { font-size: .8rem; color: var(--text-3); margin-bottom: .4rem; }
.usage-bar-track {
  height: 6px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.usage-bar-fill { height: 100%; background: var(--indigo); border-radius: 99px; transition: width .3s; }
.usage-bar-fill.danger { background: var(--red); }
.upgrade-nudge {
  margin-top: .75rem; padding: .85rem 1.1rem;
  background: var(--amber-lt); border: 1px solid #fde68a; border-radius: 10px;
  font-size: .85rem; color: #92400e; display: flex; align-items: center; gap: .75rem;
}

/* ── Tool page layout ── */
.tool-header { margin-bottom: 2rem; }
.tool-header h1 { font-family: var(--font-h); font-size: 1.8rem; font-weight: 800; margin-bottom: .35rem; }
.tool-header p { color: var(--text-2); font-size: .95rem; }
.card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card-title { font-family: var(--font-h); font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.result-box {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 1.25rem;
  font-size: .9rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}
.result-actions { display: flex; gap: .75rem; margin-top: 1rem; }

/* ── Score badge ── */
.score-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid var(--indigo); font-family: var(--font-h);
  font-size: 1.1rem; font-weight: 800; color: var(--indigo);
  margin-bottom: .5rem;
}

/* ── Budget result cards ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.cat-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: .9rem; text-align: center;
}
.cat-card .amount { font-family: var(--font-h); font-size: 1.2rem; font-weight: 800; color: var(--indigo); }
.cat-card .label { font-size: .75rem; color: var(--text-3); margin-top: .2rem; }
.sub-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--surface-2); border-radius: 9px; margin-bottom: .5rem;
  font-size: .875rem;
}
.sub-row .name { font-weight: 700; }
.sub-row .amount { color: var(--red); font-weight: 700; }
.sub-row a { font-size: .78rem; color: var(--indigo); text-decoration: none; }
.sub-row a:hover { text-decoration: underline; }
.win-row {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: 9px;
  background: var(--green-lt); border: 1px solid #86efac; margin-bottom: .5rem;
  font-size: .875rem; color: #15803d;
}
.win-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Dispute type picker ── */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.type-btn {
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 10px;
  padding: .85rem; text-align: center; cursor: pointer; transition: all .15s;
  font-family: var(--font-h); font-weight: 600; font-size: .85rem; color: var(--text-2);
}
.type-btn:hover, .type-btn.selected { border-color: var(--indigo); background: var(--indigo-lt); color: var(--indigo); }
.tone-row { display: flex; gap: .6rem; }
.tone-btn {
  padding: .45rem 1rem; border-radius: 8px; cursor: pointer;
  font-family: var(--font-h); font-weight: 600; font-size: .82rem;
  background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text-2);
  transition: all .15s;
}
.tone-btn.selected { border-color: var(--indigo); background: var(--indigo-lt); color: var(--indigo); }

/* ── AI key section ── */
.api-row {
  display: flex; gap: .75rem; align-items: center;
  padding: .75rem 1rem; background: var(--surface-2); border-radius: 10px;
  border: 1px solid var(--border); margin-top: 1rem; font-size: .83rem;
}
.api-row input { flex: 1; border: none; background: transparent; font-size: .83rem; font-family: var(--font-b); outline: none; }

/* ── Checkout page ── */
.checkout-wrap { max-width: 480px; margin: 5rem auto; padding: 0 1rem; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  padding: 2.5rem 1rem; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--surface-2);
}
.upload-zone:hover { border-color: var(--indigo); background: var(--indigo-lt); }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.upload-zone p { font-size: .9rem; color: var(--text-2); }
.upload-zone span { color: var(--indigo); font-weight: 700; cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: .75rem; }
  .sidebar-label { display: none; }
  .main-content { padding: 1.25rem; }
  .field-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
}
