/* ============================================================
   Visa Waiver Portal — Supplemental Styles
   Extends main.css from the main eVisa site
   ============================================================ */

/* ── Registration Step Wizard ──────────────────────────────── */

.step-wizard {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step-wizard__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neutral-400);
  counter-increment: step;
}
.step-wizard__item::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--neutral-300);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-wizard__item.is-active {
  color: var(--primary-700);
}
.step-wizard__item.is-active::before {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: #fff;
}
.step-wizard__item.is-complete {
  color: var(--primary-600);
}
.step-wizard__item.is-complete::before {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: #fff;
  content: "\2713";
}
.step-wizard__connector {
  flex: 1;
  height: 2px;
  background: var(--neutral-200);
  margin: 0 8px;
  min-width: 20px;
}
.step-wizard__connector.is-complete {
  background: var(--primary-600);
}

/* ── Form Steps ────────────────────────────────────────────── */

.form-step {
  display: none;
}
.form-step.is-active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.form-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--neutral-200);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group--wide { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .step-wizard { flex-wrap: wrap; gap: 4px; }
  .step-wizard__connector { display: none; }
}

/* ── Login Card ────────────────────────────────────────────── */

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  max-width: 440px;
  margin: 0 auto;
}
.login-card h2 {
  margin: 0 0 4px;
  color: var(--primary-900);
  font-size: 1.4rem;
}
.login-card p {
  margin: 0 0 24px;
  color: var(--neutral-600);
  font-size: 0.9rem;
}
.login-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--neutral-600);
}

/* ── Verify Card ───────────────────────────────────────────── */

.verify-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.verify-card h2 { margin: 0 0 8px; color: var(--primary-900); }
.verify-card p { margin: 0 0 24px; color: var(--neutral-600); font-size: 0.92rem; }

.verify-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.verify-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--neutral-300);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}
.verify-inputs input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(2, 26, 46, 0.08);
}

/* ── Dashboard ─────────────────────────────────────────────── */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary-900);
}

.waiver-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.waiver-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.waiver-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--neutral-100);
  border-bottom: 2px solid var(--neutral-200);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.waiver-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
}
.waiver-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.waiver-table tbody tr:hover {
  background: var(--neutral-50, #f8f9fb);
}
.waiver-table .empty-row td {
  text-align: center;
  padding: 48px 16px;
  color: var(--neutral-400);
  font-size: 0.95rem;
  cursor: default;
}

/* ── Status Pills ──────────────────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill--draft { background: var(--neutral-200); color: var(--neutral-600); }
.status-pill--submitted { background: #dbeafe; color: #1e40af; }
.status-pill--approved { background: #dcfce7; color: #166534; }
.status-pill--denied { background: #fee2e2; color: #991b1b; }

/* ── Alerts ────────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert--error { background: #fee2e2; color: #991b1b; }
.alert--success { background: #dcfce7; color: #166534; }
.alert--warning { background: #fef3c7; color: #92400e; }
.alert--info { background: #dbeafe; color: #1e40af; }

/* ── New Waiver: Traveller Cards ───────────────────────────── */

.traveller-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.traveller-card {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.traveller-card__photo {
  width: 64px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--neutral-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.traveller-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.traveller-card__photo svg {
  width: 28px;
  height: 28px;
  color: var(--neutral-400);
}
.traveller-card__info {
  flex: 1;
  min-width: 0;
}
.traveller-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-900);
  margin-bottom: 4px;
}
.traveller-card__meta {
  font-size: 0.82rem;
  color: var(--neutral-600);
  line-height: 1.5;
}
.traveller-card__actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  flex-shrink: 0;
}

/* ── Passport Upload Zone ──────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--neutral-300);
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--neutral-50, #f8f9fb);
}
.upload-zone:hover,
.upload-zone.is-dragover {
  border-color: var(--primary-600);
  background: rgba(2, 26, 46, 0.03);
}
.upload-zone__icon {
  margin-bottom: 8px;
  color: var(--neutral-400);
}
.upload-zone__text {
  font-size: 0.88rem;
  color: var(--neutral-600);
}
.upload-zone__text strong {
  color: var(--primary-700);
}
.upload-zone__hint {
  font-size: 0.78rem;
  color: var(--neutral-400);
  margin-top: 4px;
}

/* ── Passport Fields (auto-populated) ──────────────────────── */

.passport-fields {
  display: none;
  margin-top: 16px;
}
.passport-fields.is-visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ── Review Section ────────────────────────────────────────── */

.review-section {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.review-section h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-700);
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.review-item {
  padding: 4px 0;
}
.review-item dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500);
}
.review-item dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--primary-900);
}
@media (max-width: 600px) {
  .review-grid { grid-template-columns: 1fr; }
}

/* ── Waiver Detail Page ────────────────────────────────────── */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.detail-card h3 {
  margin: 0 0 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-700);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--neutral-200);
}
.detail-card--full {
  grid-column: 1 / -1;
}

/* ── Status Timeline ───────────────────────────────────────── */

.status-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0;
}
.status-timeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral-400);
}
.status-timeline__step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--neutral-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.status-timeline__step.is-active .dot {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: #fff;
}
.status-timeline__step.is-active {
  color: var(--primary-700);
}
.status-timeline__step.is-complete .dot {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}
.status-timeline__step.is-complete {
  color: #16a34a;
}
.status-timeline__step.is-denied .dot {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.status-timeline__step.is-denied {
  color: #dc2626;
}
.status-timeline__line {
  flex: 1;
  height: 2px;
  background: var(--neutral-200);
  min-width: 20px;
}
.status-timeline__line.is-complete {
  background: #16a34a;
}

/* ── Password Strength ─────────────────────────────────────── */

.password-strength {
  margin-top: 6px;
}
.password-strength__bar {
  height: 4px;
  border-radius: 2px;
  background: var(--neutral-200);
  position: relative;
  overflow: hidden;
}
.password-strength__bar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
  width: 0;
}
.password-strength__bar[data-strength="weak"]::after { width: 33%; background: #ef4444; }
.password-strength__bar[data-strength="fair"]::after { width: 66%; background: #f59e0b; }
.password-strength__bar[data-strength="strong"]::after { width: 100%; background: #22c55e; }

/* ── Loading ───────────────────────────────────────────────── */

.btn--loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn--loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  background: transparent;
  color: var(--primary-700);
  border: 1px solid var(--neutral-300);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--neutral-100); }

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 4px;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #fecaca; }

/* ── Download Button ───────────────────────────────────────── */

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.download-btn:hover { background: #15803d; }

/* ── Narrow container ──────────────────────────────────────── */

.narrow { max-width: 540px; margin-left: auto; margin-right: auto; }
.medium { max-width: 800px; margin-left: auto; margin-right: auto; }
