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

:root {
  --bg:          #F4F2EA;
  --bg-card:     #FFFFFF;
  --bg-card2:    #F8F7F2;
  --border:      #A9B3BC;
  --border-light:#DDD9CE;
  --accent:      #1C8391;
  --accent-hover:#816BC4;
  --accent-soft: rgba(28,131,145,.08);
  --text:        #0A4444;
  --text-muted:  #5C6B72;
  --success:     #16A34A;
  --danger:      #DC2626;
  --radius:      8px;
  --sidebar-w:   240px;
  --transition:  .3s ease;
  --shadow:      0 1px 3px rgba(10,68,68,.08);
  --shadow-md:   0 4px 16px rgba(10,68,68,.1);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Landing Page ───────────────────────────────────────────── */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}
.landing-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}
.landing-nav-actions { display: flex; align-items: center; gap: 16px; }
.landing-nav-link {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition);
}
.landing-nav-link:hover { color: var(--text); }
.btn-landing-cta {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--text);
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.btn-landing-cta:hover { background: var(--accent-hover); }

.hero {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 80px 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-content { flex: 1; }
.hero-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero-headline {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -.5px;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
}
.hero-sub em { color: var(--text); font-style: normal; font-weight: 600; }
.btn-hero {
  display: inline-block;
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--text);
  border-radius: 6px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(28,131,145,.25);
}
.btn-hero:hover { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(28,131,145,.35); }
.hero-image {
  flex: 0 0 400px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-image img { width: 100%; height: 480px; object-fit: cover; object-position: top; display: block; }

.how-it-works {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 72px 48px;
  text-align: center;
}
.how-it-works h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 48px;
}
.steps {
  display: flex;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}
.step {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.step-text strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.step-text p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.landing-cta-section {
  padding: 80px 48px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.landing-cta-section h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 32px;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

/* ── Auth Screen ────────────────────────────────────────────── */
.auth-screen {
  display: flex;
  min-height: 100vh;
}
.auth-image {
  flex: 1;
  background: url('https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&w=1000&q=80') top center/cover no-repeat;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  min-height: 100vh;
}
.auth-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,68,68,.75) 0%, rgba(10,68,68,.2) 60%, transparent 100%);
}
.auth-image-text {
  position: relative;
  z-index: 1;
  color: #fff;
}
.auth-image-text h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.auth-image-text p {
  font-size: 15px;
  opacity: .85;
  max-width: 360px;
  line-height: 1.6;
}
.auth-form-panel {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  padding: 48px 44px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon { font-size: 26px; }
.auth-logo-text {
  font-size: 20px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
}
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.auth-sub   { color: var(--text-muted); margin-bottom: 28px; }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--bg);
  border-radius: 6px;
  padding: 4px;
  border: 1px solid var(--border-light);
}
.auth-tab {
  flex: 1;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow);
}

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
}
.logo-icon { font-size: 22px; }
.logo-text  { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.3px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 2px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-size: 14px;
  transition: background var(--transition), color var(--transition);
}
.nav-item svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-item:hover  { background: var(--accent-soft); color: var(--accent); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.logout { color: var(--danger); }
.nav-item.logout:hover { background: rgba(220,38,38,.06); color: var(--danger); }

/* ── Main ───────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 36px 44px;
  max-width: calc(var(--sidebar-w) + 820px);
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

/* ── Form ───────────────────────────────────────────────────── */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.full-width  { grid-column: 1 / -1; }

.field-group label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
}
.field-group input,
.field-group textarea,
.field-group select {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  height: 40px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition), outline var(--transition);
}
.field-group textarea { height: auto; min-height: 80px; line-height: 1.5; resize: vertical; }
.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(28,131,145,.2);
  outline-offset: 1px;
}
.field-group input::placeholder,
.field-group textarea::placeholder { color: #A9B3BC; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--text);
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--text);
  width: 100%;
  justify-content: center;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Result ─────────────────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.result-header h2 { font-size: 17px; font-weight: 700; }
.result-body {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 24px;
  line-height: 1.8;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 20px;
  max-height: 480px;
  overflow-y: auto;
}
.result-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── History ────────────────────────────────────────────────── */
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
  padding: 0 12px 12px;
}
.history-table td {
  padding: 13px 12px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
.history-table tr:nth-child(even) td { background: #F4F2EA; }
.history-table tr:hover td { background: #E8EDF1; }
.history-empty { color: var(--text-muted); text-align: center; padding: 48px; }

/* ── Processing ─────────────────────────────────────────────── */
.processing {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 48px; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 20px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 100;
  color: var(--text);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Sidebar Plan Badge ──────────────────────────────────────── */
.sidebar-plan { padding: 12px 16px; }
.plan-badge-sidebar { display:flex; flex-direction:column; gap:6px; background:rgba(255,255,255,0.08); border-radius:8px; padding:12px; }
.plan-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:rgba(255,255,255,0.6); }
.plan-label.plan-pro { color:#92c9d0; }
.plan-usage { font-size:12px; color:rgba(255,255,255,0.5); }
.btn-upgrade-sidebar { margin-top:4px; background:var(--accent); color:#fff; border:none; border-radius:6px; padding:7px 12px; font-size:12px; font-weight:600; cursor:pointer; }
.btn-upgrade-sidebar:hover { background:var(--accent-hover); }

/* ── Upgrade Modal ───────────────────────────────────────────── */
.modal-backdrop { position:fixed; inset:0; background:rgba(10,68,68,0.5); display:flex; align-items:center; justify-content:center; z-index:200; padding:20px; }
.modal-card { background:var(--bg-card); border-radius:16px; padding:40px; max-width:760px; width:100%; position:relative; box-shadow:var(--shadow-lg); }
.modal-close { position:absolute; top:16px; right:20px; background:none; border:none; font-size:18px; color:var(--text-muted); cursor:pointer; }
.modal-card h2 { font-size:24px; color:var(--text); margin-bottom:8px; }
.modal-sub { color:var(--text-muted); margin-bottom:28px; }
.pricing-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.pricing-card { border:1.5px solid var(--border-light); border-radius:12px; padding:24px; display:flex; flex-direction:column; gap:12px; position:relative; }
.pricing-card.featured { border-color:var(--accent); box-shadow:0 0 0 3px rgba(28,131,145,0.12); }
.plan-badge { position:absolute; top:-11px; left:50%; transform:translateX(-50%); background:var(--accent); color:#fff; font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; white-space:nowrap; }
.pricing-card .plan-name { font-size:16px; font-weight:700; color:var(--text); }
.pricing-card .plan-price { font-size:32px; font-weight:800; color:var(--text); }
.pricing-card .plan-price span { font-size:14px; font-weight:400; color:var(--text-muted); }
.plan-features { list-style:none; display:flex; flex-direction:column; gap:8px; flex:1; }
.plan-features li { font-size:13px; color:var(--text); display:flex; align-items:center; gap:6px; }
.plan-features li::before { content:"✓"; color:var(--success); font-weight:700; }
.plan-features li.locked { color:var(--text-muted); }
.plan-features li.locked::before { content:"✗"; color:var(--text-muted); }


/* ── Logo Upload ─────────────────────────────────────────────── */
.logo-upload-area { border:1.5px dashed var(--border-light); border-radius:8px; padding:16px 20px; cursor:pointer; display:flex; align-items:center; min-height:52px; transition:border-color .15s; }
.logo-upload-area:hover { border-color:var(--accent); }
