/* src/styles.css — DCA Pro shared styles */

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

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --border: #e8e6df;
  --border-hover: #d0cdc4;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-faint: #999;
  --green: #0F6E56;
  --green-bg: #ecfdf5;
  --green-border: #6ee7b7;
  --green-dark: #065f46;
  --red: #b91c1c;
  --pro: #1D9E75;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Auth / Upgrade pages --- */
.auth-page, .upgrade-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }

.auth-wrap, .upgrade-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 20px; }

.upgrade-wrap { max-width: 480px; }

.auth-logo { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }

.pro-badge { font-size: 10px; background: var(--pro); color: #d1fae5; padding: 2px 8px; border-radius: 20px; font-weight: 700; letter-spacing: 0.04em; }

.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg); border-radius: var(--radius); padding: 3px; }

.auth-tab { flex: 1; padding: 7px; border: none; background: none; border-radius: 6px; font-size: 13px; font-family: inherit; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }

.auth-tab.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.form-group { margin-bottom: 14px; }

.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; letter-spacing: 0.02em; }

input[type="email"], input[type="password"], input[type="text"], input[type="number"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s;
}
input:focus { border-color: var(--pro); }
input:hover:not(:focus) { border-color: var(--border-hover); }

.btn-primary, .btn-upgrade {
  width: 100%; padding: 11px; background: var(--text); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: opacity 0.15s; margin-top: 4px;
}
.btn-primary:hover, .btn-upgrade:hover { opacity: 0.85; }
.btn-primary:disabled, .btn-upgrade:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-upgrade { background: var(--pro); font-size: 15px; padding: 13px; }

.auth-link { display: block; text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; text-decoration: none; }
.auth-link:hover { color: var(--text); }

.auth-fine, .upgrade-fine { font-size: 11px; color: var(--text-faint); text-align: center; margin-top: 8px; }

.auth-message { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; }
.auth-message.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-message.success { background: var(--green-bg); color: var(--green-dark); border: 1px solid var(--green-border); }

.auth-footer { font-size: 11px; color: var(--text-faint); text-align: center; }
.auth-footer a { color: var(--text-muted); text-decoration: none; }
.auth-footer a:hover { color: var(--text); }

/* --- Upgrade page --- */
.upgrade-title { font-size: 24px; font-weight: 700; text-align: center; line-height: 1.3; }
.upgrade-sub { font-size: 15px; color: var(--text-muted); text-align: center; line-height: 1.6; }

.billing-toggle { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }

.toggle-btn { flex: 1; padding: 7px 16px; border: none; background: none; border-radius: 7px; font-size: 13px; font-family: inherit; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; gap: 6px; justify-content: center; }
.toggle-btn.active { background: var(--text); color: #fff; font-weight: 500; }

.save-badge { font-size: 10px; background: #dcfce7; color: #15803d; padding: 1px 6px; border-radius: 20px; font-weight: 700; }

.pricing-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

.pricing-top { padding: 24px 24px 20px; border-bottom: 1px solid var(--border); }
.pricing-name { font-size: 12px; font-weight: 700; color: var(--pro); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.pricing-price { display: flex; align-items: baseline; gap: 2px; }
.price-amount { font-size: 40px; font-weight: 700; }
.price-period { font-size: 16px; color: var(--text-muted); }
.price-note { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.feature-list { list-style: none; padding: 20px 24px; display: flex; flex-direction: column; gap: 11px; }
.feature-list li { font-size: 14px; display: flex; align-items: flex-start; gap: 8px; }
.check { color: var(--pro); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

.upgrade-guarantee { font-size: 12px; color: var(--text-muted); text-align: center; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* --- Dashboard / App chrome --- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }

.nav-links { display: flex; gap: 2px; }
.nav-link { font-size: 13px; padding: 5px 12px; border-radius: var(--radius); color: var(--text-muted); cursor: pointer; border: none; background: none; font-family: inherit; text-decoration: none; }
.nav-link.active, .nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { font-weight: 600; }

.page-content { max-width: 960px; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }

.section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }

.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.metric-value { font-size: 22px; font-weight: 700; }
.metric-sub { font-size: 12px; margin-top: 3px; color: var(--text-faint); }
.green { color: var(--green); }
.red { color: var(--red); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Signal box */
.signal-box { background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--radius-lg); padding: 16px 18px; }
.signal-tag { font-size: 10px; font-weight: 700; background: var(--green); color: #d1fae5; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.05em; }
.signal-loading { font-size: 13px; color: var(--green); font-style: italic; }

/* Empty states */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-faint); }
.empty-state p { font-size: 13px; margin-top: 6px; }

/* Avatar */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dbeafe; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #1e40af; }

@media (max-width: 640px) {
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
