/* OFT Law Design System - Intake & Outbreak Management */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  --oft-navy: #000043;
  --oft-navy-dark: #000030;
  --oft-navy-light: #0d1259;
  --oft-emerald: #15a387;
  --oft-emerald-dark: #0e7d67;
  --oft-emerald-light: #e8f7f4;
  --oft-emerald-subtle: #f0fbf9;
  --oft-gold: #c89d5c;
  --oft-red: #dc2626;
  --oft-red-light: #fef2f2;
  --oft-blue: #2563eb;
  --oft-blue-light: #eff6ff;

  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --border-focus: #15a387;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 67, 0.08), 0 2px 4px -2px rgba(0, 0, 67, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 67, 0.1), 0 4px 6px -4px rgba(0, 0, 67, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 67, 0.15), 0 8px 10px -6px rgba(0, 0, 67, 0.08);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'Open Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, .serif-font {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--oft-navy);
}

/* Header & Nav */
.navbar {
  background: var(--oft-navy);
  color: var(--text-white);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 48, 0.2);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo {
  height: 38px;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: #fff;
}

.brand-badge {
  background: var(--oft-emerald);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  letter-spacing: 0.06em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--oft-emerald);
  color: #fff;
}

.btn-primary:hover {
  background: var(--oft-emerald-dark);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--oft-navy);
  border-color: var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-new {
  background: var(--oft-blue-light);
  color: var(--oft-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-under_review {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-retained {
  background: var(--oft-emerald-light);
  color: var(--oft-emerald-dark);
  border: 1px solid rgba(21, 163, 135, 0.3);
}

.badge-declined {
  background: var(--oft-red-light);
  color: var(--oft-red);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Cards & Containers */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--oft-navy);
  margin-bottom: 0.35rem;
}

.form-label.required::after {
  content: " *";
  color: var(--oft-red);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21, 163, 135, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* Treatment & Provider Cards */
.treatment-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.treatment-option-card:hover {
  border-color: var(--oft-navy);
  background: var(--bg-primary);
}

.treatment-option-card input[type="radio"] {
  margin-top: 0.25rem;
  cursor: pointer;
}

.provider-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  position: relative;
  transition: all 0.2s ease;
}

.provider-card:hover {
  border-color: #cbd5e1;
}

/* Checkbox & Radio Cards */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.checkbox-card:hover {
  border-color: var(--oft-emerald);
  background: var(--oft-emerald-subtle);
}

.checkbox-card input[type="checkbox"] {
  accent-color: var(--oft-emerald);
  width: 16px;
  height: 16px;
}

/* Client Intake Wizard */
.wizard-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.wizard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.wizard-steps-bar {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2.5rem;
}

.wizard-steps-bar::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-light);
  z-index: 1;
}

.step-node {
  position: relative;
  z-index: 2;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem;
  cursor: pointer;
  user-select: none;
}

.step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.step-node.active .step-bubble {
  background: var(--oft-emerald);
  border-color: var(--oft-emerald);
  color: #fff;
}

.step-node.completed .step-bubble {
  background: var(--oft-navy);
  border-color: var(--oft-navy);
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

.step-node.active .step-label {
  color: var(--oft-emerald-dark);
  font-weight: 700;
}

/* Signature Pad */
.signature-card {
  border: 2px dashed var(--oft-emerald);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 1rem;
  text-align: center;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  touch-action: none;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

/* File Upload Dropzone */
.dropzone-box {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--oft-emerald);
  background: var(--oft-emerald-subtle);
}

.upload-queue-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* Admin Table */
.data-table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-primary);
  color: var(--oft-navy);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-light);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: var(--oft-emerald-subtle);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 48, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* HIPAA & Authorization Sections */
.hipaa-text-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-main);
  max-height: 240px;
  overflow-y: auto;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.hipaa-section-title {
  font-weight: 700;
  color: var(--oft-navy);
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
  display: block;
}

.hd-auth-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-left: 4px solid var(--oft-navy);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.auth-fallback-card {
  background: #f8f9fa;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
