@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Source+Sans+3:wght@400;600;700&display=swap');

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

:root {
  --ember: #E42728; --violet: #7232A4; --green: #2CC48B;
  --bg: #F5F7FA; --surface: #FFFFFF; --border: #D6DEE8;
  --text: #1C2237; --text-muted: #6B7280;
  --heading: 'Sora', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

body {
  font-family: var(--body); background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
}

.container { max-width: 560px; margin: 0 auto; padding: 40px 20px; flex: 1; width: 100%; }

/* Header */
.header { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.header-logo { height: 28px; width: auto; flex-shrink: 0; }
.header-title { font-family: var(--heading); font-size: 1.3rem; font-weight: 700; flex: 1; }
.header-title span { color: var(--ember); }
.header-docs-link { font-size: 0.85rem; color: var(--violet); text-decoration: none; font-weight: 600; }
.header-docs-link:hover { text-decoration: underline; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { font-family: var(--heading); font-size: 1rem; font-weight: 600; margin-bottom: 16px; }

/* Tabs */
.tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.tabs-btn { flex: 1; padding: 10px; border: none; background: var(--surface); font-family: var(--body); font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
.tabs-btn:hover { background: var(--bg); }
.tabs-btn.active { background: var(--ember); color: #fff; }

/* Fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--body); font-size: 0.9rem; outline: none; transition: border-color 0.15s;
}
.field input:focus { border-color: var(--violet); }
.input-mono { font-family: var(--mono) !important; }

/* Buttons */
.btn { display: inline-block; padding: 10px 24px; border-radius: 8px; font-family: var(--body); font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; transition: background 0.15s; }
.btn--primary { background: var(--ember); color: #fff; }
.btn--primary:hover { background: #c02020; }
.btn--secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--secondary:hover { background: var(--bg); }
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1px solid var(--border); color: var(--text); font-weight: 500; border-radius: 8px; padding: 11px 24px; margin-bottom: 0; }
.btn--google:hover { background: #f8f9fa; border-color: #c0c4cc; }
.google-icon { flex-shrink: 0; }
.divider--or { display: flex; align-items: center; gap: 16px; margin: 18px 0; color: var(--text-muted); font-size: 0.8rem; }
.divider--or::before, .divider--or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.btn--sm { padding: 4px 12px; font-size: 0.8rem; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--violet); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn--sm:hover { background: var(--bg); }
.btn--full { width: 100%; }

/* Badge */
.badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge.free { background: #FEF3C7; color: #92400E; }
.badge.pro { background: #D1FAE5; color: #065F46; }

/* Row */
.row { display: flex; justify-content: space-between; align-items: center; }
.label { font-size: 0.85rem; color: var(--text-muted); }

/* Key box */
.key-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-top: 8px;
}
.key-box code { flex: 1; font-family: var(--mono); font-size: 0.85rem; word-break: break-all; }

/* Meter */
.meter { margin-top: 12px; background: var(--border); height: 6px; border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.meter-fill.low { background: var(--green); }
.meter-fill.medium { background: #F59E0B; }
.meter-fill.high { background: var(--ember); }

/* Actions */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; display: none; }
.alert--error { background: #FEF2F2; color: #991B1B; }
.alert--success { background: #ECFDF5; color: #065F46; }
.alert.is-visible { display: block; }

/* Loading */
.loading { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 0.9rem; }

/* Dev note */
.dev-note { padding: 8px 12px; background: #FEF3C7; border-radius: 8px; font-size: 0.8rem; color: #92400E; margin-bottom: 20px; }

/* Footer */
.footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); }
.footer-logo { height: 16px; width: auto; }
.footer a { color: var(--violet); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Switch */
.switch { text-align: center; margin-top: 12px; font-size: 0.85rem; color: var(--text-muted); }
.switch a { color: var(--violet); cursor: pointer; text-decoration: underline; }

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-ember { color: var(--ember); }
