/* SURN ITNM Registry - Provider Portal Styles */
/* Stanford Cardinal color palette */

:root {
  --cardinal: #8C1515;
  --cardinal-dark: #651010;
  --cardinal-light: #b83a3a;
  --cool-grey: #4D4F53;
  --light-grey: #e8e8e8;
  --sand: #F4F4F4;
  --white: #FFFFFF;
  --text: #2c2c2c;
  --text-light: #666;
  --success: #175E54;
  --warning: #b26b00;
  --border: #d0d0d0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--sand);
  line-height: 1.6;
  font-size: 15px;
}

/* ─── Typography ─── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { margin-bottom: 0.75rem; }
a { color: var(--cardinal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout Utilities ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ─── Header / Nav ─── */
.site-header {
  background: var(--cardinal);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.site-logo .logo-badge {
  background: var(--white);
  color: var(--cardinal);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.site-nav { display: flex; gap: 8px; align-items: center; }

.nav-link {
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: var(--white); text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,0.2); color: var(--white); }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, var(--cardinal-dark) 0%, var(--cardinal) 60%, #a52020 100%);
  color: var(--white);
  padding: 36px 24px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 2.3rem; font-weight: 700; margin-bottom: 12px; }
.hero .subtitle { font-size: 1.15rem; opacity: 0.9; margin-bottom: 28px; }
.hero .badge-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.hero-badge {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--cardinal); color: var(--white); }
.btn-primary:hover { background: var(--cardinal-dark); color: var(--white); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); color: var(--white); }

.btn-white { background: var(--white); color: var(--cardinal); }
.btn-white:hover { background: #f0f0f0; color: var(--cardinal); }

.btn-success { background: var(--success); color: var(--white); }
.btn-lg { padding: 13px 30px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.btn-download {
  background: var(--sand);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  justify-content: flex-start;
  padding: 12px 16px;
}
.btn-download:hover { background: #eee; color: var(--text); border-color: #bbb; }
.btn-download .dl-icon { font-size: 1.2rem; }

/* ─── Sections ─── */
.section { padding: 56px 0; }
.section-alt { background: var(--white); }
.section-dark { background: var(--cool-grey); color: var(--white); }

.section-header { margin-bottom: 40px; }
.section-header h2 { color: var(--cardinal); }
.section-header .section-subtitle { color: var(--text-light); font-size: 1rem; margin-top: 6px; }
.section-dark .section-header h2 { color: var(--white); }

/* ─── Cards ─── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  border: 1px solid var(--border);
}
.card-sm { padding: 20px; }
.card + .card { margin-top: 20px; }

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cardinal);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-grey);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { font-size: 1.15rem; }

/* ─── Info Grid ─── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cardinal);
}
.info-card .icon { font-size: 1.8rem; margin-bottom: 10px; }
.info-card h3 { font-size: 1rem; color: var(--cardinal); margin-bottom: 6px; }
.info-card p { font-size: 0.88rem; color: var(--text-light); margin: 0; }

/* ─── Stats Row ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cardinal);
}
.stat-card .stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cardinal);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card.stat-success { border-top-color: var(--success); }
.stat-card.stat-success .stat-number { color: var(--success); }
.stat-card.stat-warning { border-top-color: var(--warning); }
.stat-card.stat-warning .stat-number { color: var(--warning); }

/* ─── Forms ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.88rem; font-weight: 600; color: var(--cool-grey); }
.form-label .optional { font-weight: 400; color: var(--text-light); font-size: 0.8rem; }
.form-label .required { color: var(--cardinal); }

.form-input, .form-select, .form-textarea {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--cardinal);
  box-shadow: 0 0 0 3px rgba(140,21,21,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }

.radio-group, .checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-label input, .checkbox-label input { accent-color: var(--cardinal); }

.contact-pref-row { display: flex; flex-direction: column; gap: 8px; }
.contact-pref-row .radio-group { margin-top: 4px; }

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cardinal);
  padding: 14px 0 8px;
  border-bottom: 1px solid var(--light-grey);
  margin-bottom: 4px;
  grid-column: 1 / -1;
}

.form-hint { font-size: 0.78rem; color: var(--text-light); }

/* Contact person collapsible */
.contact-person-section {
  border: 1.5px solid var(--light-grey);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 4px;
  background: var(--sand);
  grid-column: 1 / -1;
}

/* ─── Handouts ─── */
.handout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.handout-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.handout-card .doc-icon { font-size: 2rem; }
.handout-card h4 { font-size: 0.95rem; color: var(--text); }
.handout-card p { font-size: 0.82rem; color: var(--text-light); margin: 0; }

/* ─── About Study ─── */
.study-about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.study-list { list-style: none; padding: 0; }
.study-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--light-grey);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
}
.study-list li:last-child { border-bottom: none; }
.study-list li .bullet { color: var(--cardinal); font-weight: 700; flex-shrink: 0; }

/* ─── Dashboard Charts ─── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.chart-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cool-grey);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 16px;
}
.chart-wrapper { position: relative; height: 220px; }

/* ─── Table ─── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
thead th {
  background: var(--sand);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cool-grey);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--light-grey);
  vertical-align: middle;
}
tbody tr:hover { background: var(--sand); }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: #d4f0eb; color: #175E54; }
.badge-red { background: #fde8e8; color: var(--cardinal); }
.badge-yellow { background: #fff3cd; color: #b26b00; }
.badge-grey { background: var(--light-grey); color: var(--cool-grey); }
.badge-blue { background: #e3eaf6; color: #2b4a8c; }

/* ─── Tabs ─── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--cardinal); }
.tab-btn.active { color: var(--cardinal); border-bottom-color: var(--cardinal); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Provider Profile Header ─── */
.provider-header {
  background: linear-gradient(135deg, var(--cardinal-dark), var(--cardinal));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.provider-avatar {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}
.provider-info h2 { font-size: 1.4rem; margin-bottom: 4px; }
.provider-info p { opacity: 0.85; font-size: 0.88rem; margin: 0; }
.provider-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.provider-meta-item { text-align: center; }
.provider-meta-item .num { font-size: 1.8rem; font-weight: 700; }
.provider-meta-item .lbl { font-size: 0.75rem; opacity: 0.8; }

/* ─── Admin Upload ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  background: var(--sand);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--cardinal);
  background: #fdf5f5;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone h3 { margin-bottom: 6px; color: var(--text); }
.upload-zone p { color: var(--text-light); font-size: 0.88rem; margin: 0; }

.provider-list-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.provider-list-item:hover { border-color: var(--cardinal); }

/* ─── Alerts ─── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #d4f0eb; color: #0d4039; border: 1px solid #a0d9cf; }
.alert-info { background: #e3eaf6; color: #1a3568; border: 1px solid #b0c2e8; }
.alert-warning { background: #fff3cd; color: #6b4900; border: 1px solid #ffe08a; }
.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ─── Footer ─── */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.7);
  padding: 36px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner .footer-left { font-size: 0.85rem; }
.footer-inner .footer-left strong { color: var(--white); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: rgba(255,255,255,0.55); font-size: 0.82rem; }
.footer-links a:hover { color: var(--white); }

/* ─── Step indicator ─── */
.steps-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 32px 0;
}
.step-item { flex: 1; text-align: center; position: relative; }
.step-item::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step-item:last-child::before { display: none; }
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-light);
  position: relative;
  z-index: 1;
  margin-bottom: 6px;
}
.step-item.active .step-circle { border-color: var(--cardinal); color: var(--cardinal); background: #fdf5f5; }
.step-item.done .step-circle { border-color: var(--success); background: var(--success); color: var(--white); }
.step-label { font-size: 0.75rem; color: var(--text-light); }
.step-item.active .step-label { color: var(--cardinal); font-weight: 600; }

/* ─── Outcomes table special ─── */
.outcomes-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-light); margin-bottom: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* ─── Print styles ─── */
@media print {
  .site-header, .site-footer, .tab-bar, .btn, .no-print { display: none !important; }
  .card, .chart-card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .chart-grid { grid-template-columns: 1fr; }
  .study-about { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 8px; }
  .site-nav { gap: 4px; }
  .nav-link { padding: 5px 10px; font-size: 0.82rem; }
  .provider-header { flex-direction: column; align-items: flex-start; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 16px; }
  .section { padding: 40px 0; }
}
