/* ══════════════════════════════════════════════════════════════════
   Customer Portal Styles
   Extends the main dashboard design system (styles.css)
   ══════════════════════════════════════════════════════════════════ */

@import url('/styles.css');

/* ── Portal-specific overrides ── */
:root {
  --portal-accent: #064974;
  --portal-accent-light: rgba(6, 73, 116, 0.08);
  --portal-success: #10b981;
  --portal-warning: #F97316;
  --portal-danger: #ef4444;
}

/* The dashboard's global styles.css ships DM Sans on body and #0061FF
   on links. Override at the portal scope so the customer-facing
   experience uses Montserrat + brand navy. */
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.portal-card, .main-content, .top-header, .sidebar, button, input, select, textarea {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.main-content a, .portal-card a, .top-header a {
  color: var(--portal-accent);
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Brand gradient: navy → service blue, matches customer-facing emails. */
  background: linear-gradient(135deg, #0B2E4D 0%, #064974 100%);
  font-family: 'Montserrat', sans-serif;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo img {
  height: 64px;
}
.login-logo h2 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1rem 0 0.25rem;
}
.login-logo p {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  margin: 0;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.5rem;
}
.login-card .login-subtitle {
  color: var(--text-secondary, #475569);
  font-size: 0.8125rem;
  margin: 0 0 1.5rem;
}

.login-input-group {
  margin-bottom: 1.25rem;
}
.login-input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.login-input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary, #1E293B);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.login-input-group input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(6, 73, 116, 0.12);
}
.login-input-group input::placeholder {
  color: #94A3B8;
}

.login-code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}
.login-code-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  font-family: inherit;
  color: var(--text-primary, #1E293B);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-code-inputs input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(6, 73, 116, 0.12);
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--portal-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.login-btn:hover { background: #1d4ed8; }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.login-toggle {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
}
.login-toggle a {
  color: var(--portal-accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.login-toggle a:hover { text-decoration: underline; }

.login-stay {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
}
.login-stay input[type="checkbox"] {
  accent-color: var(--portal-accent);
  width: 16px;
  height: 16px;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  display: none;
}
.login-error.show { display: block; }

.login-resend {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
}
.login-resend a {
  color: var(--portal-accent);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}
.login-resend .countdown {
  color: #94A3B8;
}

/* ── Portal Layout Overrides ── */
/* Sidebar runs full height to top */
.app-container .sidebar {
  top: 0;
}

/* Header starts after sidebar, no logo */
.app-container .top-header {
  left: var(--sidebar-width);
  display: flex;
  justify-content: flex-end;
}
.app-container .top-header .header-left {
  display: none;
}

/* ── Portal Layout ── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.portal-header-left img {
  height: 36px;
}
.portal-header-left span {
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  font-weight: 500;
}
.portal-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.portal-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
}

.portal-logout-btn {
  padding: 0.375rem 0.875rem;
  background: transparent;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.portal-logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ── Quick Action Cards (Home) ── */
.portal-welcome {
  margin-bottom: 2rem;
}
.portal-welcome h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.25rem;
}
.portal-welcome p {
  color: var(--text-secondary, #475569);
  font-size: 0.875rem;
  margin: 0;
}

.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.portal-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}
.portal-card:hover {
  border-color: var(--portal-accent);
  box-shadow: 0 4px 16px rgba(6, 73, 116, 0.1);
  transform: translateY(-2px);
}
.portal-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.portal-card-icon.blue { background: rgba(6, 73, 116, 0.1); color: #064974; }
.portal-card-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.portal-card-icon.orange { background: rgba(245, 158, 11, 0.1); color: #F97316; }
.portal-card-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.portal-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.25rem;
}
.portal-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  margin: 0;
}
.portal-card .card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--portal-accent);
  margin-top: 0.75rem;
}
.portal-card .card-value.danger { color: var(--portal-danger); }

/* ── Upcoming Appointments ── */
.portal-upcoming {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
}
.portal-upcoming h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-primary, #1E293B);
}
.portal-upcoming-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #475569);
  font-size: 0.875rem;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.upcoming-item:last-child { border-bottom: none; }

.upcoming-date {
  text-align: center;
  min-width: 48px;
}
.upcoming-date .month {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--portal-accent);
}
.upcoming-date .day {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
}
.upcoming-info h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 2px;
}
.upcoming-info p {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin: 0;
}

/* ── Data Tables (Invoices, Payments) ── */
.portal-table-container {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  overflow: hidden;
}

.portal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  padding: 0 1rem;
  overflow-x: auto;
}
.portal-tab { white-space: nowrap; flex-shrink: 0; }

/* A wide table scrolls inside its card -- never widens the page. The page's
   flex column needs min-width: 0 or a wide child blows out the body. */
.portal-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portal-table-scroll .portal-table { min-width: 640px; }
.main-content { min-width: 0; }
.portal-tab {
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.portal-tab:hover { color: var(--text-primary, #1E293B); }
.portal-tab.active {
  color: var(--portal-accent);
  border-bottom-color: var(--portal-accent);
}

.portal-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-table-header, #f9fafb);
  border-bottom: 1px solid var(--border-color, #E2E8F0);
}
.portal-summary-item label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.125rem;
}
.portal-summary-item .value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
}
.portal-summary-item .value.danger { color: var(--portal-danger); }

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.portal-table thead th {
  text-align: left;
  padding: 0.65rem 1rem;
  background: var(--bg-table-header, #f9fafb);
  color: var(--text-secondary, #475569);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
}
.portal-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  color: var(--text-primary, #1E293B);
  vertical-align: middle;
}
.portal-table tbody tr:last-child td { border-bottom: none; }
.portal-table tbody tr:hover { background: var(--bg-hover, #f9fafb); }

/* ── Status Badges ── */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-badge.paid { background: #dcfce7; color: #15803d; }
.status-badge.unpaid { background: #fef3c7; color: #92400e; }
.status-badge.partial { background: #dbeafe; color: #1d4ed8; }
.status-badge.void { background: #f3f4f6; color: #475569; }
.status-badge.overdue { background: #fef2f2; color: #dc2626; }
.status-badge.active { background: #dcfce7; color: #15803d; }
.status-badge.expired { background: #fef2f2; color: #dc2626; }
.status-badge.cancelled { background: #f3f4f6; color: #475569; }
.status-badge.completed { background: #dcfce7; color: #15803d; }
.status-badge.scheduled { background: #dbeafe; color: #1d4ed8; }
.status-badge.pending { background: #fef3c7; color: #92400e; }

/* ── Action Buttons ── */
.btn-portal {
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.btn-portal.primary {
  background: var(--portal-accent);
  color: #fff;
}
.btn-portal.primary:hover { background: #1d4ed8; }
.btn-portal.outline {
  background: transparent;
  border: 1px solid var(--border-color, #E2E8F0);
  color: var(--text-secondary, #475569);
}
.btn-portal.outline:hover {
  border-color: var(--portal-accent);
  color: var(--portal-accent);
}
.btn-portal.pay {
  background: #10b981;
  color: #fff;
}
.btn-portal.pay:hover { background: #059669; }

/* ── Timeline (Service History) ── */
.history-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
}

.history-locations {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  overflow: hidden;
}
.history-locations h3 {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 1rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  color: var(--text-primary, #1E293B);
}
.history-location-item {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  transition: background 0.12s;
}
.history-location-item:hover { background: var(--bg-hover, #f9fafb); }
.history-location-item.active {
  background: var(--portal-accent-light);
  border-left: 3px solid var(--portal-accent);
}
.history-location-item h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 2px;
}
.history-location-item p {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin: 0;
}

.history-timeline {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  position: relative;
}
.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  min-width: 70px;
  text-align: right;
}
.timeline-date .month-year {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary, #475569);
}
.timeline-date .day {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color, #E2E8F0);
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
}
.timeline-dot.completed { background: var(--portal-success); }
.timeline-dot.scheduled { background: var(--portal-accent); }

.timeline-content {
  flex: 1;
}
.timeline-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 4px;
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
}
.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Membership Cards ── */
.membership-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.membership-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.membership-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0;
}
.membership-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.membership-detail label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary, #475569);
  margin-bottom: 2px;
}
.membership-detail .value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
}
.membership-benefits {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light, #f3f4f6);
}
.membership-benefits h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.5rem;
}
.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
}
.benefit-item .check {
  color: var(--portal-success);
  font-weight: 700;
}

/* ── Equipment Cards ── */
.equipment-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.equipment-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.75rem;
}
.equipment-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  font-size: 0.8125rem;
}
.equipment-details label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary, #475569);
}
.equipment-details .value {
  color: var(--text-primary, #1E293B);
  font-weight: 500;
}

/* ── Empty States ── */
.portal-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary, #475569);
}
.portal-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.portal-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.25rem;
}
.portal-empty p {
  font-size: 0.8125rem;
  margin: 0;
}

/* ── Tab Panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Membership Section Labels ── */
.membership-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.75rem;
}

/* ── Membership Cards (enhanced) ── */
.membership-card {
  transition: box-shadow 0.2s;
}
.membership-card.active {
  border-color: #86efac;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}
.membership-card.inactive {
  opacity: 0.75;
}
.membership-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.membership-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0;
}
.membership-code {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  margin-top: 2px;
  display: inline-block;
}

.membership-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  font-size: 0.8125rem;
}
.membership-detail-row:last-child { border-bottom: none; }
.membership-detail-row .detail-label {
  color: var(--text-secondary, #475569);
  font-weight: 500;
}
.membership-detail-row span:last-child {
  font-weight: 600;
  color: var(--text-primary, #1E293B);
}

.visits-badge {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.membership-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.membership-benefits li {
  padding: 0.3rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  position: relative;
  padding-left: 1.5rem;
}
.membership-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--portal-success);
  font-weight: 700;
}

/* ── Banner (no card on file, etc.) ── */
.m-banner,
.m-banner:hover,
.m-banner:focus,
.m-banner:active {
  text-decoration: none;
}
.m-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1.25rem 0;
  transition: box-shadow 0.15s, transform 0.1s;
  border: 1px solid transparent;
}
.m-banner:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.m-banner-info {
  background: linear-gradient(90deg, #F8FAFC 0%, #F1F5F9 100%);
  border-color: #E2E8F0;
}
.m-banner-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E2E8F0;
  border-radius: 10px;
  flex-shrink: 0;
}
.m-banner-body {
  flex: 1;
  min-width: 0;
}
.m-banner-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 2px;
}
.m-banner-text {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.4;
}
.m-banner-cta {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1E293B;
  background: #fff;
  border: 1px solid #CBD5E1;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.m-banner:hover .m-banner-cta {
  background: #1E293B;
  color: #fff;
  border-color: #1E293B;
}
@media (max-width: 640px) {
  .m-banner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .m-banner-cta {
    width: 100%;
    text-align: center;
  }
}

/* ── Membership amount-due notice ──
   Same anatomy as .m-banner (icon / body / cta) but scoped INSIDE a membership
   card, so it carries no page-level margin and leads with the warning colour.
   Rendered by renderDueBanner() when the plan has an unpaid invoice. */
.m-due,
.m-due:hover,
.m-due:focus,
.m-due:active {
  text-decoration: none;
}
.m-due {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid #FDBA74;
  border-radius: 10px;
  background: linear-gradient(90deg, #FFF7ED 0%, #FFEDD5 100%);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.m-due:hover {
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
  transform: translateY(-1px);
}
.m-due-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F97316;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-due-body {
  flex: 1;
  min-width: 0;
}
.m-due-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #7C2D12;
  margin-bottom: 2px;
}
.m-due-text {
  font-size: 0.8125rem;
  color: #9A3412;
  line-height: 1.4;
}
.m-due-cta {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: #F97316;
  border: 1px solid #F97316;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  white-space: nowrap;
}
.m-due:hover .m-due-cta {
  background: #EA580C;
  border-color: #EA580C;
}
@media (max-width: 640px) {
  .m-due {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .m-due-cta {
    width: 100%;
    text-align: center;
  }
}

/* ── Membership Card v2 ── */
.m-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s;
}
.m-card.is-active {
  border-color: #BFDBFE;
  box-shadow: 0 0 0 1px rgba(6, 73, 116, 0.12);
}
.m-card.is-inactive { opacity: 0.7; }

.m-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.m-title-block {
  flex: 1;
  min-width: 0;
}
.m-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.m-meta-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.m-pill {
  display: inline-block;
  padding: 2px 10px;
  background: var(--portal-accent-light);
  color: var(--portal-accent);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.m-location {
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  font-weight: 500;
}

.m-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.m-stat {
  background: #F8FAFC;
  border: 1px solid #EEF2F6;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.m-stat.stat-done {
  background: #F1F5F9;
  border-color: #E2E8F0;
}
.m-stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.m-stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.m-stat-num {
  font-size: 1.375rem;
  color: var(--text-primary, #1E293B);
  font-weight: 700;
  line-height: 1;
}
.m-stat-num strong { font-weight: 700; }
.m-stat-total {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}
.m-stat-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #475569;
  background: #E2E8F0;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.m-stat-sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  font-weight: 500;
}
.m-stat-renew {
  color: #475569;
  font-weight: 600;
}

/* Automatic monthly billing control (portal, mig 277 follow-up).
   Full-width row BELOW the stats grid — it carries a sentence of terms and
   reads as a wrapped mess squeezed into the narrow Billing column. */
.m-autopay {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}
.m-autopay.is-on {
  background: #F0FDF4;
  border-color: #BBF7D0;
}
.m-autopay-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}
.m-autopay-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #064974;
}
.m-autopay-row strong {
  display: block;
  font-size: 0.8125rem;
  color: #1E293B;
  font-weight: 600;
}
.m-autopay-sub {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.5;
  margin-top: 2px;
  font-weight: 500;
}
.m-autopay-fine {
  font-size: 0.6875rem;
  color: #94A3B8;
  line-height: 1.5;
  margin: 7px 0 0 26px;
}
/* Already enrolled at the processor — a statement, not a control. */
.m-autopay.is-on:not(:has(input)) {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #166534;
}
.m-autopay-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
  flex-shrink: 0;
}
.m-stat-dates {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  line-height: 1.4;
}
.m-progress {
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.125rem;
}
.m-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #94A3B8 0%, #CBD5E1 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.m-stat.stat-done .m-progress-fill { background: linear-gradient(90deg, #64748B 0%, #94A3B8 100%); }

.m-visits-section {
  margin-top: 0.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light, #f3f4f6);
}
.m-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.75rem;
}
.m-visits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.m-visit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: #F8FAFC;
  border: 1px solid #EEF2F6;
  border-radius: 10px;
}
.m-visit.done {
  background: #F1F5F9;
  border-color: #E2E8F0;
}
.m-visit-icon {
  font-size: 1.125rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  flex-shrink: 0;
}
.m-visit-body {
  flex: 1;
  min-width: 0;
}
.m-visit-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin-bottom: 2px;
}
.m-visit-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.m-visit-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.m-visit-tag.done { background: #E2E8F0; color: #475569; }
.m-visit-tag.scheduled { background: #DBEAFE; color: #1D4ED8; }
.m-visit-tag.pending { background: #FEF3C7; color: #92400E; }
.m-visit-date {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  font-weight: 500;
}

.m-benefits {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light, #f3f4f6);
}
.m-benefits summary {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--portal-accent);
  cursor: pointer;
  padding: 0.25rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.m-benefits summary::-webkit-details-marker { display: none; }
.m-benefits summary::before {
  content: '▸';
  font-size: 0.6875rem;
  transition: transform 0.15s;
  display: inline-block;
}
.m-benefits[open] summary::before { transform: rotate(90deg); }
.m-benefits ul {
  list-style: none;
  padding: 0.5rem 0 0 0;
  margin: 0;
}
.m-benefits li {
  padding: 0.3rem 0 0.3rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  position: relative;
}
.m-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0.3rem;
  color: var(--portal-success);
  font-weight: 700;
}
.m-benefits li.exclusion {
  color: #94A3B8;
  font-style: italic;
}
.m-benefits li.exclusion::before {
  content: '−';
  color: #CBD5E1;
}

@media (max-width: 768px) {
  .m-stats {
    grid-template-columns: 1fr;
  }
  .m-card { padding: 1.25rem; }
  .m-title { font-size: 1rem; }
}

/* ── Upcoming Events (Memberships) ── */
.upcoming-events-list {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  overflow: hidden;
}
.upcoming-event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
}
.upcoming-event-item:last-child { border-bottom: none; }

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.event-dot.scheduled { background: var(--portal-accent); }
.event-dot.pending { background: var(--portal-warning); }

.event-info h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 3px;
}
.event-info p {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Equipment Cards (enhanced) ── */
.equipment-location-group {
  margin-bottom: 1.5rem;
}
.equipment-location-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.equipment-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.equipment-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  background: var(--bg-table-header, #f9fafb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.equipment-info {
  flex: 1;
  min-width: 0;
}
.equipment-info h4 {
  margin: 0 0 0.25rem;
}
.eq-manufacturer {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.375rem;
}
.eq-detail {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin: 0 0 2px;
}
.eq-detail span {
  font-weight: 600;
  color: var(--text-secondary, #475569);
}
.eq-warranty-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.warranty-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.warranty-badge.active {
  background: #dcfce7;
  color: #15803d;
}
.warranty-badge.expired {
  background: #fef2f2;
  color: #dc2626;
}

/* ── Book Service Page ── */
.book-service-section {
  max-width: 600px;
  margin: 0 auto;
}
.book-service-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
}
.book-icon {
  width: 80px;
  height: 80px;
  background: rgba(6, 73, 116, 0.08);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--portal-accent);
}
.book-service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.5rem;
}
.book-service-card > p {
  font-size: 0.875rem;
  color: var(--text-secondary, #475569);
  margin: 0 0 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.book-features {
  text-align: left;
  max-width: 360px;
  margin: 0 auto 1.75rem;
}
.book-feature {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
}
.book-feature svg {
  color: var(--portal-success);
  flex-shrink: 0;
}

.btn-portal.large {
  padding: 0.75rem 2rem;
  font-size: 0.9375rem;
  border-radius: 10px;
  gap: 0.5rem;
}

.book-help-text {
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  margin-top: 1.25rem;
}
.book-help-text a {
  color: var(--portal-accent);
  font-weight: 600;
  text-decoration: none;
}
.book-help-text a:hover { text-decoration: underline; }

/* Upcoming Appointments (book page) */
.upcoming-appointments-list {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.upcoming-appointments-list .upcoming-item {
  padding: 0.75rem 1.25rem;
}

/* ── Payment Methods Page ── */
.pm-section {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
}
.pm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.pm-section-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0;
}
.pm-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #475569);
  font-size: 0.875rem;
}

.pm-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pm-card-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-table-header, #f9fafb);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 12px;
  transition: box-shadow 0.15s;
}
.pm-card-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pm-card-item.expired {
  opacity: 0.6;
}

.pm-card-brand {
  flex-shrink: 0;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 34px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
}
.brand-logo.visa { background: #1a1f71; }
.brand-logo.mastercard { background: #eb001b; }
.brand-logo.amex { background: #006fcf; }
.brand-logo.discover { background: #ff6000; }
.brand-logo.default { background: #475569; }

.pm-card-info {
  flex: 1;
  min-width: 0;
}
.pm-card-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
}
.pm-card-expiry {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
  margin-top: 2px;
}
.pm-card-expiry.text-danger {
  color: var(--portal-danger);
  font-weight: 600;
}

.pm-remove-btn {
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: var(--text-secondary, #475569);
  border-radius: 6px;
  transition: all 0.15s;
}
.pm-remove-btn:hover {
  color: var(--portal-danger);
  background: #fef2f2;
}

.pm-empty {
  text-align: center;
  padding: 2.5rem 1rem;
}
.pm-empty-icon {
  color: #d1d5db;
  margin-bottom: 0.75rem;
}
.pm-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1E293B);
  margin: 0 0 0.25rem;
}
.pm-empty p {
  font-size: 0.8125rem;
  color: var(--text-secondary, #475569);
  margin: 0;
}

/* Add Card Form */
.pm-add-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.pm-add-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.pm-add-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0;
}
.pm-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.pm-close-btn:hover { color: var(--text-primary, #1E293B); }

.pm-card-error {
  color: var(--portal-danger);
  font-size: 0.8125rem;
  min-height: 1.25rem;
  margin-top: 0.5rem;
}

.pm-add-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

/* ── Portal Mobile ── */
@media (max-width: 768px) {
  /* Show hamburger and logo in header on mobile */
  .app-container .top-header .header-left {
    display: flex;
  }
  .app-container .top-header {
    left: 0;
    justify-content: space-between;
  }
  .app-container .sidebar {
    top: var(--header-height);
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .portal-cards {
    grid-template-columns: 1fr;
  }
  .history-layout {
    grid-template-columns: 1fr;
  }
  .portal-summary-bar {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .login-code-inputs input {
    width: 40px;
    height: 48px;
    font-size: 1.25rem;
  }
  .equipment-grid {
    grid-template-columns: 1fr;
  }
  .book-service-card {
    padding: 1.5rem;
  }
  .membership-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Home page + welcome step (Winter Ready phase 2, 2026-10-30).
   .ph-* = the home page, .pw-* = the welcome popup (welcome.js).
   ══════════════════════════════════════════════════════════════════ */
.ph-page { max-width: 880px; }
.ph-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color, #E2E8F0);
}
.ph-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ph-card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #0B2E4D; letter-spacing: -0.2px; }
.ph-edit {
  min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  font: 600 0.875rem Montserrat, sans-serif; color: var(--portal-accent);
}
.ph-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ph-fact-k { font-size: 0.75rem; font-weight: 600; color: #475569; margin-bottom: 2px; }
.ph-fact-v { font-size: 0.9rem; font-weight: 600; color: #0B2E4D; line-height: 1.4; overflow-wrap: anywhere; }
.ph-muted { color: #475569; font-size: 0.875rem; }
.ph-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ph-tile {
  background: #fff; border: 1px solid var(--border-color, #E2E8F0); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 120px;
  text-decoration: none; color: #0B2E4D; transition: border-color 0.15s, box-shadow 0.15s;
}
.main-content a.ph-tile { color: #0B2E4D; }
.ph-tile:hover { border-color: #469CC3; box-shadow: 0 4px 14px rgba(11, 46, 77, 0.08); }
.ph-tile-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.ph-tile-icon.orange { background: #FDEEDF; color: #B4500C; }
.ph-tile-icon.purple { background: #EDE8FB; color: #5B3FC4; }
.ph-tile-icon.green { background: #E3F4EC; color: #0F7B55; }
.ph-tile-icon.blue { background: #E3EEF6; color: #064974; }
.ph-tile-title { font-size: 0.95rem; font-weight: 700; }
.ph-tile-sub { font-size: 0.78rem; color: #475569; }
.ph-tile-sub.danger { color: var(--portal-danger); font-weight: 600; }
.ph-foot { text-align: center; font-size: 0.8rem; color: #475569; margin: 18px 0 8px; }
@media (max-width: 768px) {
  .ph-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The welcome popup: a bottom sheet on a phone, a dialog on a computer. */
.pw-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(11, 46, 77, 0.55);
  font-family: Montserrat, -apple-system, sans-serif;
}
.pw-sheet {
  background: #fff; width: 100%; max-height: 92vh; overflow-y: auto; box-sizing: border-box;
  border-radius: 22px 22px 0 0; padding: 18px 22px 26px;
  box-shadow: 0 -12px 40px rgba(11, 46, 77, 0.25);
  display: flex; flex-direction: column; gap: 12px; color: #0B2E4D;
}
@media (min-width: 769px) {
  .pw-overlay { align-items: center; }
  .pw-sheet { width: 520px; border-radius: 20px; padding: 30px 32px; }
  .pw-grab { display: none; }
}
.pw-grab { width: 40px; height: 4px; border-radius: 2px; background: #D6DEE5; align-self: center; }
.pw-top { display: flex; justify-content: space-between; align-items: center; }
.pw-step { font-size: 0.75rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 1.2px; }
.pw-dots { display: flex; gap: 6px; }
.pw-dot { width: 8px; height: 8px; border-radius: 4px; background: #D6DEE5; }
.pw-dot.past { background: #064974; }
.pw-dot.now { width: 22px; background: #064974; }
.pw-sub { margin: -4px 0 0; font-size: 0.82rem; font-weight: 600; color: #064974; }
.pw-h { margin: 4px 0 2px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.4px; }
.pw-center { text-align: center; }
.pw-label { font-size: 0.82rem; font-weight: 600; color: #475569; display: block; margin-top: 4px; }
.pw-input {
  width: 100%; box-sizing: border-box; height: 46px; border: 1px solid #C5D0DA; border-radius: 10px;
  padding: 0 14px; font: 500 16px Montserrat, sans-serif; color: #0B2E4D; background: #fff;
}
.pw-textarea { height: auto; padding: 10px 14px; resize: vertical; }
.pw-input:focus { outline: 2px solid #469CC3; outline-offset: 1px; }
.pw-row { display: flex; gap: 10px; }
.pw-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pw-link {
  align-self: flex-start; min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 0.875rem Montserrat, sans-serif; color: var(--portal-accent);
}
.pw-house {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px;
  border: 1px solid #C5D0DA; color: #475569;
}
.pw-house.on { border: 2px solid #064974; background: #F3F8FB; color: #064974; }
.pw-strong { font-size: 1rem; font-weight: 700; color: #0B2E4D; }
.pw-muted { font-size: 0.875rem; color: #475569; }
.pw-note { margin: 0; font-size: 0.82rem; color: #475569; line-height: 1.5; }
.pw-chips { display: grid; gap: 8px; }
.pw-chips.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pw-chips.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pw-chip {
  min-height: 46px; border-radius: 12px; cursor: pointer; padding: 8px 6px;
  font: 600 0.875rem Montserrat, sans-serif; color: #0B2E4D;
  border: 1px solid #C5D0DA; background: #fff;
}
.pw-chip.on { border: 2px solid #064974; background: #E7F1F7; }
.pw-chip:focus-visible, .pw-primary:focus-visible, .pw-secondary:focus-visible, .pw-link:focus-visible { outline: 2px solid #469CC3; outline-offset: 2px; }
.pw-error { margin: 0; color: #B42318; font-size: 0.85rem; font-weight: 600; }
.pw-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pw-primary {
  height: 52px; border: 0; border-radius: 999px; background: #064974; color: #fff; cursor: pointer;
  font: 700 1rem Montserrat, sans-serif; display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.pw-overlay a.pw-primary { color: #fff; }
.pw-primary[disabled] { opacity: 0.6; cursor: default; }
.pw-secondary {
  height: 44px; border: 0; background: none; cursor: pointer;
  font: 600 0.95rem Montserrat, sans-serif; color: #064974;
}
.pw-done-mark {
  width: 56px; height: 56px; border-radius: 28px; background: #E3F4EC; color: #0F7B55;
  display: flex; align-items: center; justify-content: center; align-self: center; margin-top: 6px;
}

/* The offer card + the welcome step's offer ticket (Winter Ready phase 3). */
.ph-offer {
  border-radius: 18px; background: #0B2E4D; color: #fff; padding: 20px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 28px rgba(11, 46, 77, 0.22);
}
.ph-offer.pending { background: #fff; color: #0B2E4D; border: 2px solid #064974; box-shadow: none; }
.ph-offer-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ph-offer-kicker { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #BFE0EF; }
.ph-offer.pending .ph-offer-kicker { color: #064974; }
.ph-offer-through { font-size: 0.75rem; color: #E6EEF4; }
.ph-offer-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.ph-offer-terms { font-size: 0.9rem; line-height: 1.5; color: #E6EEF4; }
.ph-offer.pending .ph-offer-terms { color: #475569; }
.ph-offer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px dashed rgba(255,255,255,0.35); padding-top: 12px; }
.ph-offer-label { font-size: 0.7rem; color: #BFE0EF; font-weight: 600; }
.ph-offer-code { font-size: 1rem; font-weight: 700; letter-spacing: 1.5px; }
.ph-offer-btn { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: #0B2E4D; font: 700 0.95rem Montserrat, sans-serif;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; align-self: flex-start; }
.main-content a.ph-offer-btn { color: #0B2E4D; }
.ph-offer.pending .ph-offer-btn { background: #064974; color: #fff; }
.pw-ticket { border-radius: 16px; background: #0B2E4D; color: #fff; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.pw-ticket-kicker { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #BFE0EF; }
.pw-ticket-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.3px; }
.pw-ticket-terms { font-size: 0.875rem; line-height: 1.5; color: #E6EEF4; }
.pw-ticket-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed rgba(255,255,255,0.35);
  padding-top: 10px; font-size: 0.78rem; color: #E6EEF4; }
.pw-ticket-code { font-size: 0.95rem; font-weight: 700; letter-spacing: 1.5px; color: #fff; }
