/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header === */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--red);
  color: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.call-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.call-btn:hover { background: var(--red-dark); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 48px 0 24px;
}

.hero-badge {
  display: inline-block;
  background: var(--red-light);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.15;
  text-wrap: balance;
}

.hero-desc {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* === Emergency Buttons Grid === */
.buttons-section {
  padding: 16px 0 48px;
}

.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.emergency-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: inherit;
  width: 100%;
}

.emergency-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.emergency-card:active {
  transform: translateY(0);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hospital-icon { background: #fef2f2; color: #dc2626; }
.ambulance-icon { background: #fff7ed; color: #ea580c; }
.icu-icon { background: #fef2f2; color: #be123c; }

.emergency-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.emergency-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

.card-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  margin-top: auto;
}

/* === How It Works === */
.how-section {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 48px 0;
}

.how-section h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--gray-900);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  text-align: center;
}

.step {
  padding: 16px;
}

.step-num {
  width: 40px;
  height: 40px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}

.step h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.step p {
  font-size: 14px;
  color: var(--gray-500);
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--gray-200);
  padding: 32px 0;
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--gray-500);
}

.footer-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray-400);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gray-100);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  transition: background 0.2s;
}

.modal-close:hover { background: var(--gray-200); }

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.modal-header p {
  font-size: 14px;
  color: var(--gray-500);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border 0.2s;
  outline: none;
  background: var(--white);
  color: var(--gray-900);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.submit-btn:hover { background: var(--red-dark); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === Success === */
.success-message {
  text-align: center;
  padding: 12px 0;
}

.success-icon {
  color: #16a34a;
  margin-bottom: 16px;
}

.success-message h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.success-message p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.done-btn {
  padding: 12px 32px;
  background: var(--gray-100);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.2s;
}

.done-btn:hover { background: var(--gray-200); }

/* === Responsive === */
@media (max-width: 640px) {
  .buttons-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .modal {
    padding: 24px 20px;
  }
}
