:root {
  --primary: #0b2545;
  --primary-light: #134074;
  --primary-btn: #0284c7;
  --primary-btn-hover: #0369a1;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 32px 16px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 860px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.04), 0 8px 10px -6px rgba(0,0,0,0.02);
  overflow: hidden;
}

.brand-header {
  background: #ffffff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-wrap {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

.header-dispatch {
  text-align: right;
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

.header-dispatch a {
  color: var(--primary-btn);
  font-weight: 700;
  text-decoration: none;
}

.urgent-banner {
  display: none;
  background: var(--danger-bg);
  border-left: 5px solid var(--danger);
  border-bottom: 1px solid var(--danger-border);
  padding: 16px 32px;
  color: #991b1b;
}

.urgent-banner.active {
  display: block;
}

.urgent-banner h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.urgent-banner p {
  font-size: 0.88rem;
  line-height: 1.4;
}

.urgent-banner a {
  color: var(--danger);
  font-weight: 700;
  text-decoration: underline;
}

form {
  padding: 28px 32px;
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 24px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.section-title:first-of-type {
  margin-top: 0;
}

.form-group {
  margin-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1e293b;
}

label span.req {
  color: var(--danger);
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-btn);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea {
  resize: vertical;
  min-height: 56px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}

.checkbox-container input {
  width: auto;
  cursor: pointer;
}

button[type="submit"], .btn-action {
  width: 100%;
  padding: 14px 20px;
  background: var(--primary-btn);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s ease;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button[type="submit"]:hover, .btn-action:hover {
  background: var(--primary-btn-hover);
}

button[type="submit"]:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.card-footer a {
  color: var(--primary-btn);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 640px) {
  .brand-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 20px 24px;
  }
  .brand-identity {
    flex-direction: column;
  }
  .header-dispatch {
    text-align: center;
  }
  form {
    padding: 20px 24px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .urgent-banner {
    padding: 14px 20px;
  }
  .card-footer {
    padding: 14px 20px;
  }
}

/* --- Portal Confirmation & Status Components --- */
.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.badge-walkthrough {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-urgent {
  background: var(--danger-bg);
  color: var(--danger);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.summary-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 20px 0 24px 0;
}

.summary-box h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  font-size: 0.9rem;
}

.summary-full-row {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-btn);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-num.emergency {
  background: var(--danger);
}