@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0B0F19;
  --bg-surface: #161B26;
  --color-primary: #FFC107;
  --color-danger: #EF4444;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --border-color: #242F41;
  --radius: 16px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --shadow-glow: 0 0 40px rgba(255, 193, 7, 0.15);
  --transition: 0.3s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #0B0F19;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: #FFD54F;
  box-shadow: 0 0 50px rgba(255, 193, 7, 0.3);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

/* ─── Cards ─── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
}

/* ─── Forms ─── */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ─── Stars ─── */

.stars {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.15s ease;
}

.star:hover {
  transform: scale(1.15);
}

.star svg {
  width: 48px;
  height: 48px;
  fill: var(--border-color);
  transition: fill 0.15s ease;
}

.star.active svg,
.star.hover svg {
  fill: var(--color-primary);
}

.stars.frozen .star {
  cursor: default;
  pointer-events: none;
}

.stars--lg .star svg {
  width: 56px;
  height: 56px;
}

.stars--sm .star svg {
  width: 36px;
  height: 36px;
}

/* ─── Navbar ─── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo__img {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.logo__text {
  line-height: 1;
}

.logo__icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-main);
  font-size: 1.1rem;
}

.hero__logo {
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
  display: block;
  filter: drop-shadow(0 0 40px rgba(255, 193, 7, 0.3));
}

.vote-card__logo-img {
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  display: block;
}

/* ─── Landing Hero ─── */

.hero {
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 193, 7, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero__title span {
  color: var(--color-primary);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ─── Features ─── */

.features {
  padding: 80px 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.feature-card:hover {
  border-color: rgba(255, 193, 7, 0.4);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 193, 7, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ─── Demo ─── */

.demo {
  padding: 80px 0;
}

.demo__box {
  max-width: 420px;
  margin: 48px auto 0;
  text-align: center;
}

.demo__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Complaint form (fade-in) ─── */

.complaint-form {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity var(--transition), max-height var(--transition), margin var(--transition);
  margin-top: 0;
}

.complaint-form.visible {
  opacity: 1;
  max-height: 400px;
  margin-top: 24px;
}

.complaint-form p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ─── Registration ─── */

.register {
  padding: 80px 0 120px;
}

.register__card {
  max-width: 520px;
  margin: 48px auto 0;
}

.register__success {
  display: none;
  text-align: center;
  padding: 24px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius);
  margin-top: 20px;
}

.register__success.visible {
  display: block;
}

/* ─── Vote Page (Mobile-first) ─── */

.vote-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-main);
}

.vote-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 40px 28px;
}

.vote-card__logo {
  width: 64px;
  height: 64px;
  background: rgba(255, 193, 7, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
}

.vote-card__name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.vote-card__prompt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.vote-card__thanks {
  display: none;
  padding: 20px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  color: #86EFAC;
  margin-top: 20px;
}

.vote-card__thanks.visible {
  display: block;
}

/* ─── Dashboard ─── */

.dashboard {
  padding: 100px 0 60px;
  min-height: 100vh;
}

.dashboard__header {
  margin-bottom: 40px;
}

.dashboard__header h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.dashboard__header p {
  color: var(--text-muted);
}

.dashboard__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .dashboard__grid {
    grid-template-columns: 1fr;
  }
}

.dashboard__section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-section {
  text-align: center;
}

.qr-section img {
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.qr-section__url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 16px;
}

/* ─── Table ─── */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.rating-badge--low {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

.rating-badge--high {
  background: rgba(255, 193, 7, 0.15);
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.settings-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  border-color: rgba(255, 193, 7, 0.4);
  color: var(--color-primary);
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

/* ─── Auth page ─── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-card__subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-card__footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-card__footer a {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.settings-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 24px 0 16px;
  color: var(--text-main);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-label--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Footer ─── */

.footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ─── 404 ─── */

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.error-page h1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ─── Loading ─── */

.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── How it works ─── */

.how-it-works {
  padding: 80px 0;
  background: linear-gradient(180deg, transparent, rgba(22, 27, 38, 0.5), transparent);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.step {
  text-align: center;
  position: relative;
}

.step__number {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: var(--bg-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 auto 16px;
}

.step h3 {
  margin-bottom: 8px;
}

.step p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
