/* Voting website aesthetic theme */
:root {
  --primary-bg: #0f172a;
  --secondary-bg: #111827;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: rgba(15, 23, 42, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  color: var(--text-primary);
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(165,180,252,0.15), transparent 30%),
    linear-gradient(135deg, #020617 0%, var(--primary-bg) 45%, var(--secondary-bg) 100%);
  background-size: 120% 120%;
  animation: backgroundShift 18s ease-in-out infinite alternate;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(1rem, 4vw, 2rem) clamp(0.5rem, 2vw, 1rem);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  position: relative;
  z-index: 1;
  width: min(100%, 960px);
  max-width: 100vw;
  margin: 0 auto;
  padding: 0 1rem;
}

@keyframes backgroundShift {
  0% {
    background-position: 0% 30%;
  }
  50% {
    background-position: 100% 70%;
  }
  100% {
    background-position: 0% 30%;
  }
}

h1,
h2 {
  margin: 0;
  text-align: center;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: 0 16px 34px rgba(59,130,246,0.15);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(0.9rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  margin-top: 0.65rem;
  margin-bottom: 1.8rem;
  letter-spacing: 0.08em;
}

form {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: clamp(16px, 3vw, 28px);
  box-shadow: 0 32px 120px var(--shadow);
  padding: clamp(1.5rem, 4vw, 2rem);
  backdrop-filter: blur(12px);
  width: 100%;
}

form div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  align-items: center;
  justify-items: center;
}

.candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  transition: transform 0.28s ease, background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  width: 100%;
  max-width: 300px;
  cursor: pointer;
}

.candidate:hover {
  transform: translateY(-4px);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.16);
}

.candidate input[type='radio'] {
  margin-bottom: 0.5rem;
}

.candidate input[type='radio']:checked + label {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.candidate img {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s ease;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

label:hover {
  color: #bfdbfe;
}

input[type='radio'] {
  accent-color: var(--accent);
  transform: scale(1.2);
}

input[type='number'],
input[type='text'],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-primary);
  outline: none;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.14);
}

button {
  width: min(100%, 240px);
  margin: 1rem auto 0;
  display: block;
  padding: 1rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  background-size: 200% 200%;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-position 0.5s ease;
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.28);
  animation: buttonGlow 6s ease infinite;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 56px rgba(56, 189, 248, 0.38);
  background-position: 100% 0;
}

@keyframes buttonGlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@media (min-width: 768px) {
  form div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .candidate {
    max-width: none;
  }
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
  form div {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 1.2rem;
  }

  .candidate {
    max-width: none;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  form {
    padding: 1.8rem 1.5rem;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .candidate {
    padding: 1rem;
    max-width: 100%;
  }

  label {
    font-size: 1rem;
  }
}

/* ALL MOBILE CHANGES STRICTLY CONTAINED HERE */
@media (max-width: 480px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    padding: 1rem 0.5rem;
  }

  .container {
    overflow-x: hidden;
  }

  .candidate {
    padding: 0.95rem 0.85rem;
  }

  .candidate label {
    font-size: 1rem;
  }

  h1 {
    line-height: 1.2;
  }

  form {
    padding: 1.5rem 1rem;
    -webkit-backdrop-filter: blur(12px);
  }

  .candidate {
    max-width: 100%;
    padding: 1.2rem 1rem;
  }

  .candidate:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .candidate img {
    max-width: 100px;
  }

  label {
    padding: 0.5rem;
    touch-action: manipulation;
  }

  label:active {
    color: #bfdbfe;
  }

  input[type='number'],
  input[type='text'],
  select,
  textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  button {
    width: 100%;
    font-size: 16px;
    touch-action: manipulation;
  }

  button:active {
    transform: translateY(-2px);
    box-shadow: 0 24px 46px rgba(56, 189, 248, 0.34);
  }
}