/* Minimal hand-written styles -- no framework, keep it simple. */

:root {
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --text: #1c2126;
  --muted: #6b7280;
  --border: #e2e5e9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --green: #15803d;
  --green-bg: #dcfce7;
  --yellow: #92400e;
  --yellow-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

header.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
}

nav.tabs {
  display: flex;
  gap: 0.5rem;
}

nav.tabs button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

nav.tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  margin-top: 0.9rem;
}

label:first-child {
  margin-top: 0;
}

input, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

textarea {
  min-height: 5rem;
  resize: vertical;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

button.primary {
  margin-top: 1.1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

button.primary:hover {
  background: var(--accent-hover);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

button.link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}

button.secondary {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.message {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.message.success {
  background: var(--green-bg);
  color: var(--green);
}

.message.error {
  background: var(--red-bg);
  color: var(--red);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.pending {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge.ok {
  background: var(--green-bg);
  color: var(--green);
}

.badge.error {
  background: var(--red-bg);
  color: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.pnl-positive {
  color: var(--green);
  font-weight: 600;
}

.pnl-negative {
  color: var(--red);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.account-row:last-child {
  border-bottom: none;
}

.account-row .details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.account-row .nickname {
  font-weight: 600;
}

.account-row .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.account-row .error-detail {
  font-size: 0.8rem;
  color: var(--red);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.auth-card {
  max-width: 400px;
  margin: 3rem auto 0;
}

nav.tabs button.logout {
  border-color: transparent;
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 0.5rem;
}

.rule-form select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
}

button.secondary.danger {
  color: var(--red);
  border-color: var(--red-bg);
}

/* ---------- Public landing (hidden once signed in) ---------- */

body.signed-in #landing {
  display: none;
}

#landing {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.landing-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

.landing-inner h2 {
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.landing-features .feature {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}

.landing-features h3,
.landing-how h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.landing-features p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.landing-how ol {
  margin: 0.25rem 0 0;
  padding-left: 1.4rem;
}

.landing-how li {
  margin-bottom: 0.4rem;
}

.landing-sms-note {
  font-size: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.landing-disclaimer {
  margin-bottom: 0;
}

.hero {
  text-align: center;
  padding: 0.5rem 0 1.5rem;
}

.hero h2 {
  font-size: 1.9rem;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 0.5rem;
}

.hero-note {
  margin-top: 0.6rem;
}

button.cta {
  font-size: 1.05rem;
  padding: 0.7rem 1.6rem;
}

.sample-alert {
  margin: 1.5rem 0;
}

.sample-alert h3 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

.sms-bubble {
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

.sms-bubble .sms-from {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.landing-faq {
  margin: 1.75rem 0;
}

.landing-faq h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.landing-faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
}

.landing-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.landing-faq details p {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.landing-pricing {
  margin: 1.75rem 0;
}

.landing-pricing h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.price-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  background: var(--bg);
}

.price-card-pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.price-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.price-amount {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.price-per {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}

.price-card ul {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.price-card li {
  margin-bottom: 0.3rem;
}

.pricing-note {
  margin-top: 0.75rem;
}

.landing-cta-final {
  text-align: center;
  margin: 2rem 0 1.5rem;
}

.landing-cta-final h3 {
  margin-bottom: 0.25rem;
}

/* ---------- Footer and legal pages ---------- */

.site-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}

.site-footer a {
  color: var(--muted);
}

.legal-page h2 {
  margin-top: 0;
}

.legal-page h3 {
  margin-top: 1.5rem;
  font-size: 1rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}

.plain-link {
  color: inherit;
  text-decoration: none;
}

.consent-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}
