/* ============ APP-WIDE UI ============ */

/* Nav */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-logout {
  color: var(--text-muted);
}

.nav-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* Landing nav CTA button */
.landing-nav .nav-cta {
  padding: 8px 18px;
  font-size: 0.875rem;
  margin-left: 8px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-primary.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  width: 100%;
  justify-content: center;
}

.btn-primary.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ============ SIGNUP PAGE ============ */
.signup-page {
  padding: 40px 24px 80px;
  min-height: calc(100vh - 64px);
}

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

.signup-header {
  text-align: center;
  margin-bottom: 48px;
}

.signup-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.signup-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

/* Tier Cards */
.tier-section {
  margin-bottom: 60px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tier-card:hover {
  background: var(--bg-card-hover);
}

.tier-card.tier-featured {
  border-color: rgba(232, 106, 46, 0.4);
}

.tier-card.tier-active {
  border-color: var(--accent);
  background: rgba(232, 106, 46, 0.05);
  box-shadow: 0 0 0 2px rgba(232, 106, 46, 0.2);
}

.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.tier-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.tier-price {
  margin-bottom: 16px;
}

.tier-price-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.tier-price-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.tier-coverage {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.coverage-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
}

.coverage-label {
  color: var(--text-muted);
}

.coverage-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-display);
}

.tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.feat-yes::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.feat-yes { color: var(--text-secondary); }
.feat-no::before { content: '✗ '; color: var(--text-muted); }
.feat-no { color: var(--text-muted); }

.tier-select-btn {
  width: 100%;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tier-select-btn:hover,
.tier-active .tier-select-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Signup form section */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.selected-plan-banner {
  background: rgba(232, 106, 46, 0.08);
  border: 1px solid rgba(232, 106, 46, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.selected-plan-banner strong {
  color: var(--accent);
}

.monthly-preview {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 10px;
}

.monthly-preview strong {
  color: var(--accent);
  font-size: 1.1rem;
}

/* ============ AUTH PAGES ============ */
.centered-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card, .success-card, .error-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-card h1, .success-card h1, .error-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.success-icon {
  width: 56px;
  height: 56px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #4ade80;
  margin-bottom: 20px;
}

.success-card p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ============ APP SHELL ============ */
.app-main {
  min-height: calc(100vh - 64px);
  padding: 40px 24px 80px;
}

.app-container {
  max-width: 1060px;
  margin: 0 auto;
}

.app-container-sm {
  max-width: 720px;
}

/* ============ DASHBOARD ============ */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.dash-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dash-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: 0.02em;
}

.label-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-display);
}

.status-active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-past_due { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-cancelled, .status-inactive { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}

.dash-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-display);
  margin-bottom: 8px;
}

.dash-card-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.dash-card-accent {
  color: var(--accent);
}

.dash-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-section {
  margin-bottom: 40px;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.dash-section-header .dash-section-title {
  margin-bottom: 0;
}

.dash-section-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

/* Coverage detail grid */
.coverage-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.coverage-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.cd-icon {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.cd-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-display);
}

.cd-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cd-green { color: #4ade80; }

/* Claims table */
.claims-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.claims-table {
  width: 100%;
  border-collapse: collapse;
}

.claims-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-family: var(--font-display);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.claims-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.claims-table tr:last-child td {
  border-bottom: none;
}

.claim-row {
  cursor: pointer;
  transition: background 0.1s;
}

.claim-row:hover {
  background: var(--bg-card-hover);
}

.claim-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-display);
  display: inline-block;
}

.claim-status-lg {
  font-size: 0.82rem;
  padding: 5px 16px;
}

.claim-status-submitted { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.claim-status-under_review { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.claim-status-approved { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.claim-status-paid { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.claim-status-denied { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Billing row */
.billing-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.billing-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
  text-align: center;
}

.empty-state-lg {
  padding: 60px 40px;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.empty-state a {
  color: var(--accent);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* ============ PAGE HEADERS ============ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
}

.page-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ============ CLAIM FORM ============ */
.claim-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.incidents-remaining {
  margin-top: 4px;
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  font-family: var(--font-display);
}

.badge-red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  font-family: var(--font-display);
}

/* ============ CLAIM DETAIL ============ */
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.detail-item-full {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.detail-description {
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.detail-review-note {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Claim timeline */
.claim-status-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
}

.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.step-done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.step-denied .step-dot {
  background: #f87171;
  border-color: #f87171;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 500;
}

.step-done .step-label {
  color: var(--text-primary);
}

.step-line {
  flex: 2;
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .app-nav { padding: 0 16px; }

  .tier-grid { grid-template-columns: 1fr; }

  .form-grid { grid-template-columns: 1fr; }

  .dash-cards { grid-template-columns: 1fr 1fr; }

  .dash-header { flex-direction: column; }

  .page-header { flex-direction: column; }

  .detail-grid { grid-template-columns: 1fr 1fr; }

  .billing-row { flex-direction: column; align-items: flex-start; }

  .form-section { padding: 24px; }

  .claim-form { padding: 24px; }

  .signup-page { padding: 24px 16px 60px; }

  .claim-status-timeline { flex-direction: column; gap: 12px; }

  .step-line { width: 1px; height: 20px; margin-bottom: 0; }
}

@media (max-width: 480px) {
  .dash-cards { grid-template-columns: 1fr; }
}
