@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --gold: #c9a94e;
  --gold-light: #e4cc7a;
  --gold-dark: #a8872e;
  --charcoal: #1a1a2e;
  --charcoal-light: #222240;
  --slate: #2d2d4a;
  --surface: #ffffff;
  --surface-warm: #faf9f7;
  --text: #1a1a2e;
  --text-muted: #6b6b80;
  --text-light: #9a9ab0;
  --border: #e8e6e1;
  --border-light: #f0eee9;
  --primary: #1a1a2e;
  --success: #2d7a4f;
  --warning: #b8860b;
  --danger: #a63d40;
  --info: #2e6b8a;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(26,26,46,0.06);
  --shadow-md: 0 8px 40px rgba(26,26,46,0.08);
  --shadow-lg: 0 16px 64px rgba(26,26,46,0.10);
  --shadow-gold: 0 8px 32px rgba(201,169,78,0.15);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-warm);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(201,169,78,0.15);
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.brand {
  font-weight: 800;
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.brand .muted {
  opacity: 0.5;
  font-weight: 600;
  color: #fff;
}

.nav a {
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  transition: all 0.2s;
}

.nav a:hover {
  color: var(--gold);
  border-color: rgba(201,169,78,0.3);
  background: rgba(201,169,78,0.06);
}

main {
  flex: 1;
  padding: 0;
}

main > .container {
  padding-top: 32px;
  padding-bottom: 48px;
}

.footer {
  text-align: center;
  padding: 28px 0;
  color: var(--text-light);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.3px;
  font-family: inherit;
}

.btn-primary {
  color: #fff;
  background: var(--charcoal);
  box-shadow: 0 4px 16px rgba(26,26,46,0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26,26,46,0.24);
  background: var(--charcoal-light);
}

.btn-gold {
  color: var(--charcoal);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(201,169,78,0.25);
}

.btn-secondary {
  background: var(--charcoal);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,26,46,0.12);
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: rgba(201,169,78,0.03);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-full { width: 100%; }

.flashwrap { margin: 18px 0; }

.flashwrap .flash,
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
}

.flash.success, .alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash.error, .flash.danger, .alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash.warning, .alert-warning { background: #fefce8; color: #854d0e; border-color: #fef08a; }
.flash.info, .alert-info { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-hero {
  background: var(--charcoal);
  background-image:
    radial-gradient(ellipse 800px 400px at 20% 50%, rgba(201,169,78,0.08), transparent),
    radial-gradient(ellipse 600px 300px at 80% 30%, rgba(201,169,78,0.05), transparent);
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.login-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,78,0.3), transparent);
}

.login-brand {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 24px;
}

.login-title {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.login-title em {
  font-style: normal;
  color: var(--gold);
}

.login-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.login-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 24px 64px;
  background: var(--surface-warm);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.login-card .login-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-card label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.login-card input[type="email"],
.login-card input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--surface-warm);
  margin-bottom: 20px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,78,0.1);
}

.login-card button {
  width: 100%;
  padding: 14px 24px;
  background: var(--charcoal);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.login-card button:hover {
  background: var(--charcoal-light);
  box-shadow: 0 8px 24px rgba(26,26,46,0.2);
  transform: translateY(-1px);
}

.login-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 700px;
  margin-top: 40px;
  width: 100%;
}

.login-feature {
  text-align: center;
  padding: 24px 16px;
}

.login-feature .feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(201,169,78,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 18px;
  color: var(--gold-dark);
  font-weight: 800;
}

.login-feature h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.login-feature p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.magic-link-result {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(201,169,78,0.2);
  margin-top: 24px;
  text-align: center;
}

.magic-link-result h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.magic-link-result .muted {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.magic-link-result input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: monospace;
  background: var(--surface-warm);
  color: var(--text);
  cursor: pointer;
}

.magic-link-result input:focus {
  outline: none;
  border-color: var(--gold);
}

.dashboard-header {
  margin: 8px 0 28px;
}

.dashboard-header h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: var(--text);
}

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

.card-header h3 { margin-bottom: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-warm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,78,0.1);
}

.form-group-btn { margin-bottom: 18px; }

.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.table thead th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.table tbody tr {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(26,26,46,0.04);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,26,46,0.08);
}

.table tbody td {
  padding: 14px 14px;
  font-size: 14px;
  vertical-align: middle;
  border: none;
}

.table tbody tr td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.table tbody tr td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.td-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.td-next {
  white-space: normal;
  color: var(--text-muted);
  font-size: 13px;
}

td.actions { white-space: normal; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ire { background: rgba(201,169,78,0.1); color: var(--gold-dark); }
.badge-warning { background: rgba(184,134,11,0.1); color: var(--warning); }
.badge-success { background: rgba(45,122,79,0.1); color: var(--success); }

.empty-state {
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.score-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.score-ire::before { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.score-me::before { background: linear-gradient(90deg, var(--success), #4ade80); }
.score-next::before { background: linear-gradient(90deg, var(--info), #38bdf8); }

.score-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 700;
}

.score-value {
  display: block;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.score-value-sm { font-size: 18px; font-weight: 700; }
.score-max { font-size: 14px; color: var(--text-light); font-weight: 500; }

.score-ire .score-value { color: var(--gold-dark); }
.score-me .score-value { color: var(--success); }
.score-next .score-value { color: var(--info); }

.empty-hero {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.empty-hero h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-hero p {
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.form-container {
  max-width: 480px;
  margin: 40px auto;
  background: var(--surface);
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.form-wide { max-width: 720px; }

.form-container h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

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

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
}

.form-footer a {
  color: var(--gold-dark);
  text-decoration: none;
  font-weight: 600;
}

.form-footer a:hover { text-decoration: underline; }

.section-header {
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.section-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 0.3px;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(26,26,46,0.03);
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: var(--shadow);
}

.question-text {
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.rating-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.rating-label { cursor: pointer; }
.rating-label input { display: none; }

.rating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--text-muted);
}

.rating-label input:checked + .rating-btn {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--gold-light);
}

.rating-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.rating-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 8px;
  padding: 0 4px;
  font-weight: 500;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  gap: 16px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-hero-compact {
  padding: 56px 24px 40px;
}

.login-card input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--surface-warm);
  margin-bottom: 20px;
}

.login-card input[type="tel"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,78,0.1);
}

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

h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .login-hero { padding: 56px 20px 40px; }
  .login-title { font-size: 28px; }
  .login-features { grid-template-columns: 1fr; gap: 8px; }
  .login-feature { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .table-responsive { overflow-x: auto; }
  .table { min-width: 700px; }
  .login-card { padding: 28px 24px; }
}
