/* ==========================================================================
   IMA Visakhapatnam Branch Elections 2026 - Modern UI/UX Stylesheet
   ========================================================================== */

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-alt: #f8fafd;
  --navy: #0b1f3a;
  --navy-light: #13315c;
  --primary: #1456b8;
  --primary-hover: #0e4496;
  --primary-soft: #e8f1ff;
  --accent: #0f9d58;
  --accent-soft: #e6f7ee;
  --whatsapp: #128c7e;
  --whatsapp-bright: #25d366;
  --gold: #d97706;
  --gold-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(11, 31, 58, 0.08), 0 4px 10px -4px rgba(11, 31, 58, 0.04);
  --shadow-lg: 0 20px 40px -10px rgba(11, 31, 58, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header & Navigation */
.site-header {
  background: linear-gradient(135deg, #09182e 0%, #123568 60%, #1456b8 100%);
  color: #ffffff;
  border-bottom: 3px solid #eab308;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #ffffff;
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-top: 2px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.25);
}

/* Main Container */
.main-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.narrow-container {
  max-width: 640px;
  margin: 0 auto;
}

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.step-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.step-item.active .step-num {
  background: var(--primary);
  color: #ffffff;
}

.step-item.done {
  border-color: #bbf7d0;
  background: var(--accent-soft);
  color: #166534;
}

.step-item.done .step-num {
  background: var(--accent);
  color: #ffffff;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.card-header h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}

.card-header p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.card-body {
  padding: 26px;
}

/* Hero Section */
.hero-card {
  background: linear-gradient(145deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 38px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  border-radius: 18px;
  background: #ffffff;
  padding: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hero-title {
  margin: 0 0 10px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0 auto 24px;
  max-width: 640px;
  font-size: 1.02rem;
  color: var(--text-muted);
}

.hero-meta-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.meta-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* How it works grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.info-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.info-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.info-step-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--navy);
}

.info-step-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Form Elements */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(20, 86, 184, 0.14);
}

.form-control-lg {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 15px 18px;
}

.form-hint {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(20, 86, 184, 0.28);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-success {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 157, 88, 0.25);
}

.btn-success:hover {
  background: #0b8449;
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #0c6b60;
}

.btn-outline {
  background: #ffffff;
  color: var(--navy);
  border: 1.5px solid var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface-alt);
  border-color: var(--navy);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* Alerts & Banners */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--accent-soft);
  color: #166534;
  border-color: #bbf7d0;
}

.alert-warning {
  background: var(--gold-soft);
  color: #92400e;
  border-color: #fde68a;
}

.alert-danger {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-info {
  background: var(--primary-soft);
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Member Details Box */
.member-summary {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}

.member-row:last-child {
  border-bottom: none;
}

.member-row-label {
  color: var(--text-light);
  font-weight: 600;
}

.member-row-value {
  color: var(--navy);
  font-weight: 700;
  text-align: right;
}

/* Ballot & Candidate Cards */
.ballot-toolbar {
  position: sticky;
  top: 8px;
  z-index: 30;
  background: rgba(11, 31, 58, 0.96);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

.ballot-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ballot-toolbar h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.ballot-toolbar p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.selection-counter {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

.selection-counter.ready {
  background: #16a34a;
  border-color: #4ade80;
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.candidate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.candidate-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.candidate-card.selected {
  border-color: var(--primary);
  background: #f0f6ff;
  box-shadow: 0 0 0 4px rgba(20, 86, 184, 0.16), var(--shadow-md);
}

.candidate-card.disabled-card {
  opacity: 0.58;
}

.candidate-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.candidate-check-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #ffffff;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  transition: all 0.16s ease;
  z-index: 2;
}

.candidate-card.selected .candidate-check-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.candidate-photo-wrap {
  width: 100%;
  aspect-ratio: 4 / 4.2;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.candidate-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.candidate-no {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 7px;
  align-self: flex-start;
}

.candidate-name {
  margin: 0 0 4px;
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
}

.candidate-post {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-light);
  font-weight: 600;
}

.ballot-submit-bar {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

/* Admin Layout */
.admin-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 85px);
}

.admin-sidebar {
  background: #0f2342;
  color: #e2e8f0;
  padding: 22px 14px;
  border-right: 1px solid #1e3a5f;
}

.admin-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 10px 12px 6px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 9px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration: none;
}

.admin-nav-link.active {
  background: var(--primary);
  color: #ffffff;
}

.admin-content {
  padding: 26px 28px 48px;
  min-width: 0;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: 6px;
}

.stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--surface-alt);
  color: var(--navy);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-voted {
  background: var(--accent-soft);
  color: #166534;
}

.badge-pending {
  background: var(--gold-soft);
  color: #92400e;
}

/* Results Bar */
.result-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
}

.progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #2563eb 100%);
  border-radius: 999px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.82rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Responsive */
@media (max-width: 860px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid #1e3a5f;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }
  .brand-text h1 {
    font-size: 0.88rem;
  }
  .brand-text span {
    font-size: 0.7rem;
  }
  .header-badge {
    display: none;
  }
  .main-container {
    padding: 14px 12px 40px;
  }
  .stepper {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
  }
  .step-item {
    flex-direction: column;
    text-align: center;
    padding: 7px 4px;
    gap: 4px;
    font-size: 0.68rem;
    line-height: 1.15;
  }
  .step-num {
    width: 20px;
    height: 20px;
    font-size: 0.68rem;
  }
  .hero-card {
    padding: 20px 16px;
    margin-bottom: 18px;
  }
  .hero-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 10px;
  }
  .hero-eyebrow {
    font-size: 0.7rem;
    padding: 4px 10px;
    margin-bottom: 10px;
  }
  .hero-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 14px;
  }
  .card-header {
    padding: 14px 16px 12px;
  }
  .card-header h2 {
    font-size: 1.12rem;
  }
  .card-body {
    padding: 16px;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .ballot-toolbar {
    top: 6px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
    margin-bottom: 14px;
  }
  .ballot-toolbar h3 {
    font-size: 0.92rem;
  }
  .ballot-toolbar p {
    font-size: 0.76rem;
  }
  .ballot-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .selection-counter {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  .candidates-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .candidate-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 11px 44px 11px 11px;
  }
  .candidate-photo-wrap {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 72px;
    height: 76px;
    aspect-ratio: auto;
    margin-bottom: 0;
    border-radius: 10px;
  }
  .candidate-no {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 3px;
  }
  .candidate-name {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.96rem;
    margin-bottom: 2px;
  }
  .candidate-post {
    grid-column: 2;
    grid-row: 3;
    font-size: 0.76rem;
  }
  .candidate-check-badge {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }
  .result-row {
    grid-template-columns: 52px 1fr;
  }
  .result-score {
    grid-column: 1 / -1;
  }
}
