/**
 * District Diagnostic Styles
 * Plat Street - Block Ops
 */

/* ===== Back Button ===== */
.diagnostic-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(250, 249, 246, 0.7) !important;
  font-family: var(--f-ui), system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  z-index: 10;
}

.diagnostic-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FAF9F7 !important;
  text-decoration: none !important;
}

.diagnostic-back-btn svg {
  opacity: 0.8;
}

/* ===== Hero Section ===== */
.diagnostic-hero {
  position: relative;
  background: linear-gradient(135deg, var(--brand-ink) 0%, #1a1612 100%);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid rgba(181, 97, 10, 0.2);
}

.diagnostic-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.diagnostic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(181, 97, 10, 0.15);
  border: 1px solid rgba(181, 97, 10, 0.3);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bo-accent);
}

.badge-divider {
  opacity: 0.5;
}

.diagnostic-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: #FAF9F7;
  margin: 0 0 1rem;
  line-height: 1.1;
}

.diagnostic-subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: rgba(245, 240, 232, 0.7);
  max-width: 550px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.diagnostic-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bo-accent);
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 232, 0.5);
  margin-top: 0.25rem;
}

/* ===== Form Section ===== */
.diagnostic-form-section {
  background: #FAFAF8;
  padding: 3rem 1rem;
  min-height: 60vh;
}

.form-container {
  max-width: 680px;
  margin: 0 auto;
}

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.form-header p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Form Steps */
.form-step {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #B5610A 0%, #D4790F 100%);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(181, 97, 10, 0.3);
}

.step-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: none;
  letter-spacing: 0;
}

.step-intro {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 1.25rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  background: #f8f8f8;
  border-radius: 8px;
  border-left: 3px solid #B5610A;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.5rem;
}

.form-group label .required {
  color: #c53030;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: #1a1a1a;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #ccc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #B5610A;
  box-shadow: 0 0 0 4px rgba(181, 97, 10, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #aaa;
}

.form-hint {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
}

.form-group.full-width {
  width: 100%;
  flex: 0 0 100%;
}

/* District Search */
.district-search-wrapper {
  position: relative;
  display: block;
}

.district-search-input-container {
  position: relative;
}

.district-search-wrapper input,
.form-group .district-search-wrapper input {
  padding: 0.9rem 3rem 0.9rem 2.75rem;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
  z-index: 2;
}

.search-icon svg {
  width: 18px;
  height: 18px;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: #e5e5e5;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 2;
}

.search-clear:hover {
  background: #d0d0d0;
}

.search-clear svg {
  width: 14px;
  height: 14px;
  color: #666;
}

/* Search Loading Indicator */
.search-loading {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.search-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f0f0f0;
  border-top-color: #B5610A;
  border-radius: 50%;
  animation: search-spin 0.7s linear infinite;
}

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

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}

.search-result-item {
  padding: 1rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

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

.search-result-item:hover {
  background: #f8f8f8;
}

.search-result-item:active {
  background: #f0f0f0;
}

.result-name {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.result-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.result-type {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #B5610A 0%, #D4790F 100%);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--bo-muted);
}

.search-no-results a {
  color: var(--bo-accent);
  text-decoration: underline;
}

/* Manual Entry Form */
.manual-entry-form {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.manual-entry-header {
  margin-bottom: 1.25rem;
}

.manual-entry-header h4 {
  font-family: var(--f-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
}

.manual-entry-header p {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

.manual-entry-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
}

.manual-entry-success {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}

.manual-entry-success svg {
  width: 20px;
  height: 20px;
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 2px;
}

.manual-entry-success p {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: #166534;
  margin: 0;
  line-height: 1.4;
}

/* Selected District */
.selected-district {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(181, 97, 10, 0.08) 0%, rgba(181, 97, 10, 0.04) 100%);
  border: 2px solid rgba(181, 97, 10, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
  gap: 1rem;
}

.selected-district-info {
  flex: 1;
  min-width: 0;
}

.selected-name {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.35rem;
}

.selected-meta {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: #666;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.selected-type {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #B5610A 0%, #D4790F 100%);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.change-district-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #ddd;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.change-district-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

.change-district-btn svg {
  width: 14px;
  height: 14px;
}

/* Yes/No Questions */
.yes-no-questions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.yes-no-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f8f8f8;
  border-radius: 12px;
  gap: 1rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.yes-no-item:hover {
  background: #f5f5f5;
}

.question-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #333;
  flex: 1;
  line-height: 1.4;
}

.yes-no-toggle {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.yes-no-toggle button {
  padding: 0.6rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yes-no-toggle button:hover {
  border-color: #B5610A;
  color: #B5610A;
  background: rgba(181, 97, 10, 0.05);
}

.yes-no-toggle button.active {
  background: linear-gradient(135deg, #B5610A 0%, #D4790F 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(181, 97, 10, 0.3);
}

/* Step Actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #B5610A 0%, #D4790F 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(181, 97, 10, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(181, 97, 10, 0.4);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #f8f8f8;
  border-color: #ccc;
  color: #333;
}

.btn-primary svg,
.btn-secondary svg {
  width: 16px;
  height: 16px;
}

.btn-submit {
  min-width: 180px;
}

/* Form Error */
.form-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.form-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Progress Indicator */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 2rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.progress-step.active .progress-dot {
  background: var(--bo-accent);
  box-shadow: 0 0 0 4px rgba(181, 97, 10, 0.2);
}

.progress-step.completed .progress-dot {
  background: var(--bo-accent);
}

.progress-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bo-muted);
}

.progress-step.active .progress-label {
  color: var(--bo-accent);
  font-weight: 600;
}

.progress-line {
  width: 60px;
  height: 2px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 0.5rem;
  margin-bottom: 1.5rem;
  transition: background 0.3s;
}

.progress-line.active {
  background: var(--bo-accent);
}

/* ===== Info Section ===== */
.diagnostic-info-section {
  background: var(--brand-ink);
  padding: 4rem 1.5rem;
}

.info-container {
  max-width: 900px;
  margin: 0 auto;
}

.info-container h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: #FAF9F7;
  text-align: center;
  margin: 0 0 2.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(181, 97, 10, 0.15);
  border-radius: 10px;
  margin-bottom: 1rem;
  color: var(--bo-accent);
}

.info-icon svg {
  width: 24px;
  height: 24px;
}

.info-card h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: #FAF9F7;
  margin: 0 0 0.5rem;
}

.info-card p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(245, 240, 232, 0.6);
  margin: 0;
  line-height: 1.5;
}

.info-note {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(181, 97, 10, 0.1);
  border: 1px solid rgba(181, 97, 10, 0.2);
  border-radius: 10px;
  padding: 1.25rem;
}

.info-note svg {
  width: 24px;
  height: 24px;
  color: var(--bo-accent);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.info-note p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(245, 240, 232, 0.8);
  margin: 0;
  line-height: 1.5;
}

.info-note strong {
  color: #FAF9F7;
}

/* ===== Processing Overlay ===== */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 19, 15, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 1rem;
}

.processing-content {
  text-align: center;
  max-width: 520px;
  width: 100%;
  padding: 1.5rem;
  margin: auto;
}

.processing-icon {
  margin-bottom: 1rem;
}

.processing-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.processing-dots .dot {
  width: 10px;
  height: 10px;
  background: #B5610A;
  border-radius: 50%;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.processing-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.processing-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse-dot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.processing-title {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #FAF9F7;
  margin: 0 0 0.5rem;
}

.processing-district {
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: #B5610A;
  margin: 0 0 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(181, 97, 10, 0.15);
  border-radius: 6px;
  display: inline-block;
}

.processing-steps {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.processing-column {
  flex: 1;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.processing-step.active {
  opacity: 1;
}

.processing-step.done {
  opacity: 0.6;
}

.processing-step .step-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}

.processing-step.active .step-icon {
  color: #B5610A;
}

.processing-step.done .step-icon {
  color: #4ade80;
}

.processing-step .step-icon svg {
  width: 18px;
  height: 18px;
}

.processing-step .step-text {
  font-family: var(--f-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: #ccc;
}

.processing-step.active .step-text {
  color: #FAF9F7;
}

.processing-step .step-detail {
  font-family: var(--f-body);
  font-size: 0.7rem;
  color: #666;
  margin-left: auto;
  padding-right: 0.5rem;
}

.processing-step.active .step-detail {
  color: #999;
}

.processing-step .step-check {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.processing-step.done .step-check {
  opacity: 1;
  transform: scale(1);
  color: #4ade80;
}

.processing-step .step-check svg {
  width: 16px;
  height: 16px;
}

.processing-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.processing-stats .stat {
  text-align: center;
}

.processing-stats .stat-value {
  display: block;
  font-family: var(--f-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #B5610A;
  transition: all 0.3s ease;
}

.processing-stats .stat-label {
  font-family: var(--f-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

.processing-note {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

/* Processing Error State */
.processing-error-state {
  text-align: center;
  padding: 1rem 0;
}

.error-shake {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 50%;
  margin-bottom: 0.75rem;
  animation: shake 0.5s ease-in-out;
}

.error-shake svg {
  width: 28px;
  height: 28px;
  color: #ef4444;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.processing-error-text {
  font-family: var(--f-ui);
  font-size: 0.9rem;
  color: #ef4444;
  margin: 0;
}

/* ===== Error Content (inside overlay) ===== */
.processing-overlay .error-content {
  max-width: 400px;
  width: 90%;
  padding: 2rem 1.5rem;
  margin: auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.error-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.error-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.error-title {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.25rem;
}

.error-subtitle {
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 1.25rem;
}

.error-district {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.error-district-name {
  display: block;
  font-family: var(--f-serif);
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.15rem;
}

.error-district-meta {
  font-family: var(--f-ui);
  font-size: 0.8rem;
  color: #666;
}

.error-suggestions {
  text-align: left;
  background: #f9f9f9;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.error-suggestions p {
  font-family: var(--f-ui);
  font-size: 0.8rem;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
}

.error-suggestions ul {
  margin: 0;
  padding-left: 1.1rem;
}

.error-suggestions li {
  font-family: var(--f-body);
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.35rem;
}

.error-suggestions li:last-child {
  margin-bottom: 0;
}

.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.error-actions .btn-secondary,
.error-actions .btn-primary {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  max-width: 160px;
}

/* ===== Success Content (inside overlay) ===== */
.processing-overlay .success-content {
  max-width: 400px;
  width: 90%;
  padding: 2rem 1.5rem;
  margin: auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.success-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.success-title {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.25rem;
}

.success-subtitle {
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 1.25rem;
}

.success-district {
  background: linear-gradient(135deg, rgba(181, 97, 10, 0.08) 0%, rgba(181, 97, 10, 0.04) 100%);
  border: 1px solid rgba(181, 97, 10, 0.15);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.success-district-name {
  display: block;
  font-family: var(--f-serif);
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.15rem;
}

.success-district-meta {
  font-family: var(--f-ui);
  font-size: 0.8rem;
  color: #666;
}

.success-timeline {
  text-align: left;
  margin-bottom: 1.25rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-icon {
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-icon svg {
  width: 16px;
  height: 16px;
  color: #B5610A;
}

.timeline-content {
  flex: 1;
}

.timeline-content strong {
  display: block;
  font-family: var(--f-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.1rem;
}

.timeline-content p {
  font-family: var(--f-body);
  font-size: 0.75rem;
  color: #666;
  margin: 0;
  line-height: 1.35;
}

.success-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.success-actions .btn-secondary,
.success-actions .btn-primary {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
}

/* ===== Responsive ===== */

/* iPad / Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .diagnostic-hero {
    padding: 3rem 2rem 2.5rem;
  }
  
  .diagnostic-title {
    font-size: 3rem;
  }
  
  .diagnostic-form-section {
    padding: 2rem 1.5rem;
  }
  
  .form-card {
    padding: 2rem;
  }
  
  .form-step {
    padding: 1.75rem;
  }
  
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .success-screen,
  .error-screen {
    padding: 2.5rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .diagnostic-hero {
    padding: 2.5rem 1rem 2rem;
  }
  
  .diagnostic-title {
    font-size: 2rem;
  }
  
  .diagnostic-subtitle {
    font-size: 1rem;
  }
  
  .diagnostic-stats {
    gap: 1.5rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .diagnostic-form-section {
    padding: 1.5rem 1rem;
  }
  
  .form-header h2 {
    font-size: 1.25rem;
  }
  
  .form-header p {
    font-size: 0.9rem;
  }
  
  .form-step {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .step-header {
    margin-bottom: 1rem;
  }
  
  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .step-title {
    font-size: 0.85rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .form-group label {
    font-size: 0.8rem;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.85rem 1rem;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  .selected-district {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .change-district-btn {
    width: 100%;
    justify-content: center;
  }
  
  .yes-no-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.875rem;
  }
  
  .question-text {
    font-size: 0.9rem;
  }
  
  .yes-no-toggle {
    width: 100%;
  }
  
  .yes-no-toggle button {
    flex: 1;
    padding: 0.75rem 1rem;
  }
  
  .step-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding-top: 1rem;
    margin-top: 1rem;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 1rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .info-card {
    padding: 1.25rem;
  }
  
  .info-card h3 {
    font-size: 0.95rem;
  }
  
  .info-card p {
    font-size: 0.85rem;
  }
  
  .form-progress {
    margin-top: 1.5rem;
  }
  
  .progress-line {
    width: 20px;
  }
  
  .progress-label {
    font-size: 0.55rem;
  }
  
  .progress-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .diagnostic-hero {
    padding: 2rem 0.75rem 1.5rem;
  }
  
  .diagnostic-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.75rem;
  }
  
  .diagnostic-title {
    font-size: 1.75rem;
  }
  
  .diagnostic-stats {
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 1.25rem;
  }
  
  .form-step {
    padding: 1rem;
  }
  
  .search-icon {
    display: none;
  }
  
  .district-search-wrapper input {
    padding-left: 1rem;
  }
  
  .search-results {
    max-height: 250px;
  }
  
  .search-result-item {
    padding: 0.875rem 1rem;
  }
  
  .result-name {
    font-size: 0.95rem;
  }
  
  .selected-name {
    font-size: 1rem;
  }
  
  .processing-content {
    padding: 1.25rem;
    max-width: 100%;
  }
  
  .processing-dots .dot {
    width: 8px;
    height: 8px;
  }
  
  .processing-icon {
    margin-bottom: 0.75rem;
  }
  
  .processing-content {
    padding: 1rem;
  }
  
  .processing-title {
    font-size: 1.1rem;
  }
  
  .processing-district {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    margin-bottom: 1rem;
  }
  
  /* Success/Error in overlay - mobile */
  .processing-overlay .success-content,
  .processing-overlay .error-content {
    padding: 1.5rem 1rem;
    width: 92%;
    max-width: 340px;
  }
  
  .success-icon,
  .error-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
  }
  
  .success-icon svg,
  .error-icon svg {
    width: 28px;
    height: 28px;
  }
  
  .success-title,
  .error-title {
    font-size: 1.25rem;
  }
  
  .success-subtitle,
  .error-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .success-district,
  .error-district {
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
  }
  
  .success-district-name,
  .error-district-name {
    font-size: 0.9rem;
  }
  
  .timeline-item {
    padding: 0.5rem 0;
    gap: 0.6rem;
  }
  
  .timeline-icon {
    width: 28px;
    height: 28px;
  }
  
  .timeline-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .timeline-content strong {
    font-size: 0.75rem;
  }
  
  .timeline-content p {
    font-size: 0.7rem;
  }
  
  .success-actions,
  .error-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .success-actions .btn-secondary,
  .success-actions .btn-primary,
  .error-actions .btn-secondary,
  .error-actions .btn-primary {
    max-width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }
  
  .error-suggestions {
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
  }
  
  .error-suggestions p {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
  }
  
  .error-suggestions li {
    font-size: 0.7rem;
  }
  
  .processing-step {
    padding: 0.4rem 0;
  }
  
  .processing-step .step-icon {
    width: 20px;
    height: 20px;
  }
  
  .processing-step .step-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .processing-step .step-text {
    font-size: 0.75rem;
  }
  
  .processing-steps {
    flex-direction: column;
    gap: 0;
  }
  
  .processing-step .step-check {
    width: 16px;
    height: 16px;
  }
  
  .processing-step .step-check svg {
    width: 12px;
    height: 12px;
  }
  
  .processing-stats {
    gap: 1.25rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
  }
  
  .processing-stats .stat-value {
    font-size: 1.25rem;
  }
  
  .processing-stats .stat-label {
    font-size: 0.55rem;
  }
  
  .processing-note {
    font-size: 0.75rem;
  }
  
  .success-screen {
    padding: 1.5rem 1rem;
    margin: 0 -0.5rem;
    border-radius: 12px;
  }
  
  .success-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }
  
  .success-icon svg {
    width: 30px;
    height: 30px;
  }
  
  .success-title {
    font-size: 1.35rem;
  }
  
  .success-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .success-district {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
  }
  
  .success-district-name {
    font-size: 1rem;
  }
  
  .success-district-meta {
    font-size: 0.8rem;
  }
  
  .timeline-item {
    gap: 0.75rem;
    padding: 0.75rem 0;
  }
  
  .timeline-icon {
    width: 36px;
    height: 36px;
  }
  
  .timeline-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .timeline-content strong {
    font-size: 0.85rem;
  }
  
  .timeline-content p {
    font-size: 0.8rem;
  }
  
  .success-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .success-actions .btn-secondary,
  .success-actions .btn-primary {
    max-width: none;
    padding: 0.9rem 1.5rem;
  }
  
  .error-screen {
    padding: 1.5rem 1rem;
    margin: 0 -0.5rem;
    border-radius: 12px;
  }
  
  .error-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }
  
  .error-icon svg {
    width: 30px;
    height: 30px;
  }
  
  .error-title {
    font-size: 1.35rem;
  }
  
  .error-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .error-district {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
  }
  
  .error-suggestions {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .error-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .error-actions .btn-secondary,
  .error-actions .btn-primary {
    max-width: none;
    padding: 0.9rem 1.5rem;
  }
}
