:root {
  --primary: #132A54; /* Navy Blue */
  --saffron: #FF671F; /* India Saffron */
  --green: #046A38;   /* India Green */
  --white: #FFFFFF;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-active: #2563EB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* All Party Theme Colors - Uniform Royal Blue */
  --party-blue: #1D4ED8;
  --party-blue-light: #EFF6FF;
  --party-blue-border: #BFDBFE;
  --party-blue-dark: #1E3A8A;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tricolor Top Bar */
.tricolor-stripe {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, #FF671F 0%, #FF671F 33.3%, #FFFFFF 33.3%, #FFFFFF 66.6%, #046A38 66.6%, #046A38 100%);
}

/* Header */
.app-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #132A54 0%, #1D4ED8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 22px;
  box-shadow: 0 2px 6px rgba(19, 42, 84, 0.25);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Language Toggle */
.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 30px;
  padding: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-pill {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.lang-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(19, 42, 84, 0.2);
}

/* Main Container */
.main-wrapper {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 40px;
  flex: 1;
}

/* Banner Card */
.survey-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  color: #FFFFFF;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.survey-banner::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,103,31,0.25) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #E2E8F0;
}


.survey-banner h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
}

.survey-banner p {
  font-size: 0.9rem;
  color: #CBD5E1;
  font-weight: 400;
}

/* Progress Section */
.progress-card {
  background: #FFFFFF;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar-container {
  height: 8px;
  background: #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 33%;
  background: linear-gradient(90deg, var(--saffron) 0%, #2563EB 50%, var(--green) 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Card */
.survey-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  padding: 24px 20px;
  margin-bottom: 24px;
}

/* Wizard Pages */
.wizard-page {
  display: none;
}

.wizard-page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid #E2E8F0;
}

.wizard-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.wizard-step-badge {
  background: #EFF6FF;
  color: #1D4ED8;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.context-selection-pill {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
  color: #1E40AF;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #E2E8F0;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
  padding-bottom: 0;
}

.section-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.section-label .required-star {
  color: #DC2626;
  margin-left: 2px;
}

.section-label .optional-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

.section-helper {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Form Inputs */
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 1rem;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input.input-error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.mobile-inline-popup {
  position: relative;
  margin-top: 10px;
  padding: 10px 14px;
  background: #FEF2F2;
  border: 1.5px solid #DC2626;
  border-radius: var(--radius-sm);
  color: #991B1B;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.15);
  animation: mobilePopupIn 0.2s ease-out;
}

.mobile-inline-popup::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: #FEF2F2;
  border-top: 1.5px solid #DC2626;
  border-left: 1.5px solid #DC2626;
  transform: rotate(45deg);
}

@keyframes mobilePopupIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-size: 1rem;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  transition: all 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Age Options Grid */
.age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.age-option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.2s ease;
  user-select: none;
}

.age-option-label:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
}

input[type="radio"]:checked + .age-option-label {
  border-color: var(--primary);
  background: #EFF6FF;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(19, 42, 84, 0.2);
}

/* Party Cards Grid - ALL PARTIES UNIFORM BLUE */
.party-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .party-grid {
    grid-template-columns: 1fr 1fr;
  }
  .party-card-full {
    grid-column: 1 / -1;
  }
}

.party-card-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 2px solid var(--party-blue-border);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  user-select: none;
}

.party-card-label:hover {
  border-color: var(--party-blue);
  background: #F8FAFC;
}

.party-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--party-blue-light);
  color: var(--party-blue);
  border: 1px solid var(--party-blue-border);
}

.party-info {
  flex: 1;
}

.party-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--party-blue); /* ALL parties in blue */
  line-height: 1.25;
}

.party-symbol-text {
  font-size: 0.75rem;
  color: #3B82F6; /* ALL parties in blue */
}

/* Checked State for ALL Party Cards - Uniform Blue */
input[type="radio"]:checked + .party-card-label {
  border-color: var(--party-blue);
  background: var(--party-blue-light);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

input[type="radio"]:checked + .party-card-label .party-name {
  color: var(--party-blue-dark); /* Uniform deep blue */
  font-weight: 800;
}

input[type="radio"]:checked + .party-card-label .party-symbol-text {
  color: #1D4ED8;
}

input[type="radio"]:checked + .party-card-label .party-badge-icon {
  background: var(--party-blue);
  color: #FFFFFF;
  border-color: var(--party-blue);
}

/* Candidate Selection Cards */
.candidate-container {
  min-height: 80px;
}

.candidate-placeholder {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}

.candidate-placeholder .icon {
  font-size: 28px;
  margin-bottom: 6px;
  display: block;
}

.candidate-placeholder p {
  font-size: 0.9rem;
}

.candidate-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.candidate-item-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.candidate-item-label:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.cand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.cand-details {
  flex: 1;
}

.cand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.cand-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.party-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.72rem;
  color: #FFFFFF;
  background-color: #1D4ED8;
}

input[type="radio"]:checked + .candidate-item-label {
  border-color: #2563EB;
  background: #EFF6FF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

input[type="radio"]:checked + .candidate-item-label .cand-avatar {
  background: #2563EB;
  color: #FFFFFF;
}

.custom-candidate-input-box {
  margin-top: 10px;
  padding: 12px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  border: 1px solid #CBD5E1;
  animation: fadeIn 0.25s ease;
}

/* Wizard Navigation Buttons */
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.btn-wizard-next, .btn-submit {
  flex: 1;
  height: 52px;
  background: linear-gradient(135deg, #132A54 0%, #1E40AF 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(19, 42, 84, 0.25);
}

.btn-wizard-next:hover, .btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0F172A 0%, #1D4ED8 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(19, 42, 84, 0.35);
}

.btn-wizard-next:active, .btn-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-wizard-back {
  height: 52px;
  padding: 0 20px;
  background: #F1F5F9;
  color: #334155;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-wizard-back:hover {
  background: #E2E8F0;
}

.privacy-notice {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Alert Boxes */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.2s ease;
}

.alert-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

/* Success / Thank You Screen */
.thankyou-card {
  display: none;
  text-align: center;
  padding: 40px 24px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  animation: fadeIn 0.4s ease;
}

.thankyou-icon {
  width: 72px;
  height: 72px;
  background: #ECFDF5;
  border: 3px solid #10B981;
  color: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 18px;
}

.thankyou-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.thankyou-subtitle {
  font-size: 1rem;
  color: #475569;
  margin-bottom: 24px;
}

.receipt-box {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #E2E8F0;
}

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

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

.receipt-row .value {
  font-weight: 700;
  color: var(--text-main);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  height: 48px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #E2E8F0;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: #FFFFFF;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.footer-links a {
  color: #2563EB;
  text-decoration: none;
  font-weight: 600;
}

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

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Popup Dialog */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.popup-card {
  width: 100%;
  max-width: 400px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  border-top: 4px solid #DC2626;
  text-align: center;
}

.popup-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 10px;
}

.popup-message {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-popup-ok {
  width: 100%;
  height: 44px;
  background: #1E3A8A;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-popup-ok:hover {
  background: #1D4ED8;
}

/* Company / Survey Conducted By Card on Thank You Screen */
.company-promo-card {
  margin-top: 28px;
  padding: 24px 20px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  text-align: center;
}

.company-pill {
  display: inline-block;
  padding: 5px 14px;
  background: #EFF6FF;
  color: #1E40AF;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.company-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.3;
  margin-bottom: 6px;
}

.company-tagline {
  font-size: 0.85rem;
  color: #64748B;
  margin-bottom: 20px;
}

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

.company-btn-primary {
  height: 48px;
  background: #1E3A8A;
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 0.96rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease;
}

.company-btn-primary:hover {
  background: #1D4ED8;
}

.company-btn-outline {
  height: 46px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.company-btn-outline:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.company-copyright {
  margin-top: 18px;
  font-size: 0.76rem;
  color: #64748B;
}
