/* ==========================================================
   Modern Survey & Community Outreach Design System
   Font: Poppins & Mukta (Hindi)
   ========================================================== */

:root {
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-light: #fff7ed;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Mukta', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* Background Decoration */
.page-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 380px;
  background: var(--bg-gradient);
  z-index: -1;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: var(--shadow-md);
}

.page-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(249, 115, 22, 0.15), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.15), transparent 50%);
  pointer-events: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Header */
.survey-header {
  text-align: center;
  padding: 24px 16px 36px;
  color: #ffffff;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fed7aa;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.badge-tag svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.survey-title {
  font-family: 'Mukta', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.survey-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
}

/* Form Card */
.form-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-xl);
  padding: 32px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

/* Section Card Header */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #f1f5f9;
}

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.col-full {
  grid-column: 1 / -1;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.req-star {
  color: var(--danger);
  font-weight: bold;
}

.sub-label {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: normal;
  margin-left: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 10px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  outline: none;
  transition: var(--transition);
}

.form-control.has-icon {
  padding-left: 42px;
}

.form-control:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
  background: var(--danger-light);
}

.form-control.is-valid {
  border-color: var(--success);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
  cursor: pointer;
}

select.form-control:disabled {
  background-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.7;
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  resize: vertical;
  padding: 12px 16px;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.invalid-feedback {
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-group.has-error .invalid-feedback {
  display: block;
}

/* Radio / Chip Buttons */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.chip-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.chip-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-text {
  padding: 8px 18px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-label:hover .chip-text {
  border-color: var(--primary);
  background: #f1f5f9;
}

.chip-label input[type="radio"]:checked + .chip-text {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}

/* Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.custom-checkbox span {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.4;
}

/* Submit Button & Actions */
.form-actions {
  margin-top: 10px;
  text-align: center;
}

.btn-submit {
  width: 100%;
  max-width: 440px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1.15rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(249, 115, 22, 0.45);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-submit.loading .spinner {
  display: inline-block;
}

.btn-submit.loading .btn-text {
  display: none;
}

/* Alert Boxes */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  display: none;
  font-size: 0.95rem;
  line-height: 1.5;
  align-items: center;
  gap: 12px;
}

.alert-box.show {
  display: flex !important;
}

.alert-box.alert-error {
  background: var(--danger-light);
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* Success Modal / Screen */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

.success-overlay.show {
  opacity: 1;
  visibility: visible;
}

.success-card {
  background: #ffffff;
  max-width: 520px;
  width: 100%;
  border-radius: var(--border-radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.show .success-card {
  transform: scale(1);
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon-wrap svg {
  width: 44px;
  height: 44px;
}

.success-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.success-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-id-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 6px 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 24px;
}

.btn-another {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-another:hover {
  background: var(--primary-hover);
}

/* Footer */
.survey-footer {
  text-align: center;
  margin-top: 30px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px 40px;
  }
  .form-card {
    padding: 24px 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .survey-title {
    font-size: 1.7rem;
  }
  .survey-subtitle {
    font-size: 0.95rem;
  }
  .btn-submit {
    width: 100%;
    max-width: 100%;
  }
}

/* ==========================================================
   Custom Searchable Select Component
   ========================================================== */
.search-select-wrapper {
  position: relative;
  width: 100%;
}

.search-select-trigger {
  width: 100%;
  height: 48px;
  padding: 10px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition);
  text-align: left;
}

.search-select-trigger:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #ffffff;
}

.search-select-trigger:focus,
.search-select-wrapper.open .search-select-trigger {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.12);
}

.search-select-trigger:disabled {
  background-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.7;
}

.trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.trigger-text.placeholder {
  color: #94a3b8;
  font-weight: normal;
}

.trigger-arrow {
  color: #64748b;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.search-select-wrapper.open .trigger-arrow {
  transform: rotate(180deg);
}

.search-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 1100;
  display: none;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

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

.search-select-wrapper.open .search-select-dropdown {
  display: block;
}

.search-select-header {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.search-select-input {
  width: 100%;
  height: 38px;
  padding: 6px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  outline: none;
  background: #ffffff;
  transition: var(--transition);
}

.search-select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-select-list {
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.search-select-item {
  padding: 9px 16px;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-select-item:hover,
.search-select-item.highlighted {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.search-select-item.selected {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.search-select-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
