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

:root {
  --bg: #020617;
  --bg-card: #0f172a;
  --bg-input: #0b1120;
  --border: #1e293b;
  --border-focus: #f59e0b;
  --text: #e2e8f0;
  --text-bright: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, .logo-text {
  font-family: 'Space Grotesk', sans-serif;
}

/* === Header === */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  background: var(--bg);
}

.header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.logo-icon {
  color: var(--accent);
  font-size: 14px;
}

#user-area {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.user-email { color: var(--text-muted); }

/* === Main === */
main { flex: 1; padding: 40px 24px; }

.screen { max-width: 1200px; margin: 0 auto; }

/* === Auth Card === */
.auth-card {
  max-width: 420px;
  margin: 80px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.auth-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--text-bright); }

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-message {
  font-size: 14px;
  margin-top: 8px;
  min-height: 20px;
}

.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

/* === Inputs === */
input, textarea, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.6; }

textarea { resize: vertical; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #020617;
  font-weight: 700;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; width: 100%; }

/* === Spinner === */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(2,6,23,0.3);
  border-top-color: #020617;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === App Layout === */
.app-container { max-width: 800px; margin: 0 auto; }

.input-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.input-panel h1 { font-size: 22px; margin-bottom: 4px; color: var(--text-bright); }
.input-panel .subtitle { margin-bottom: 24px; }

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

.form-group label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.required { color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Results === */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-header h2 { font-size: 20px; color: var(--text-bright); }

/* Verdict Card */
.verdict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

.verdict-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  padding: 8px 32px;
  border-radius: 100px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.verdict-badge.go { background: #065f46; color: #6ee7b7; border: 2px solid #10b981; }
.verdict-badge.maybe { background: #78350f; color: #fcd34d; border: 2px solid #f59e0b; }
.verdict-badge.pivot { background: #1e3a5f; color: #93c5fd; border: 2px solid #3b82f6; }
.verdict-badge.avoid { background: #7f1d1d; color: #fca5a5; border: 2px solid #ef4444; }

.verdict-reason {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Scores Grid */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.score-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.score-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 22px;
  font-weight: 800;
}

.score-value.high { color: #10b981; }
.score-value.mid { color: #f59e0b; }
.score-value.low { color: #ef4444; }

.score-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.score-bar-fill.high { background: #10b981; }
.score-bar-fill.mid { background: #f59e0b; }
.score-bar-fill.low { background: #ef4444; }

.score-reasoning {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Analysis Sections */
.analysis-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.analysis-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-bright);
}

.analysis-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-section li {
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.analysis-section li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

#risks-section li::before { color: var(--danger); }
#suggestions-section li::before { color: var(--info); }

/* Price Grid */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.price-item {
  text-align: center;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.price-item .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.price-item .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.sources-list li {
  font-size: 13px;
  opacity: 0.7;
}

/* Error Panel */
.error-panel {
  background: #1c1012;
  border: 1px solid #ef44444d;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: #fca5a5;
  margin-top: 16px;
}

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #475569;
}

/* === Responsive === */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .scores-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .input-panel { padding: 20px; }
  main { padding: 20px 16px; }
}
