/* GCIT x GCPHN Supplementary Evidence Portal */
/* Design: Clean, professional, health-sector appropriate */

:root {
  /* GCIT brand (from 2025 Brand Guidelines) */
  --gcit-primary: #147B8C;
  --gcit-mint: #34C9A1;
  --gcit-gold: #FFDD9B;
  --gcit-deep-teal: #007F73;
  --gcit-navy: #143D60;
  --gcit-sage: #A3D1C6;
  --gcit-copper: #A27B5C;
  --gcit-coral: #E07A5F;
  --gcit-cream: #F8F3D9;

  /* Legacy aliases */
  --gcit-blue: #143D60;
  --gcit-accent: #34C9A1;

  /* GCPHN brand */
  --gcphn-teal: #007F73;
  --gcphn-teal-light: #EBF7F4;

  /* Neutral palette (from GCIT brand guidelines) */
  --bg: #FBF7F3;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #DDEBEF;
  --border-light: #EBF7F4;
  --text-primary: #232323;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-inverse: #ffffff;

  /* Status */
  --success: #007F73;
  --success-bg: #EBF7F4;
  --warning: #A27B5C;
  --warning-bg: #FBF7F3;
  --info: #147B8C;
  --info-bg: #DDEBEF;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography (from GCIT brand: Poppins for headings, Inter for body) */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --max-width: 1200px;
  --sidebar-width: 280px;
  --header-height: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ============ LOGIN PAGE ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gcit-navy) 0%, var(--gcit-primary) 50%, var(--gcit-deep-teal) 100%);
  padding: var(--space-lg);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3xl);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card .logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.login-card .logo-row img {
  height: 48px;
  width: auto;
}

.login-card .logo-row .divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.login-card h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--gcit-navy);
  margin-bottom: var(--space-xs);
}

.login-card .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.login-card .secure-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--gcit-deep-teal);
  background: var(--gcphn-teal-light);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 100px;
  margin-bottom: var(--space-xl);
}

.login-card .secure-badge svg {
  width: 14px;
  height: 14px;
}

.login-form .field {
  margin-bottom: var(--space-md);
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.login-form input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--gcit-mint);
  box-shadow: 0 0 0 3px rgba(52, 201, 161, 0.15);
}

.login-form button {
  width: 100%;
  padding: 0.75rem;
  background: var(--gcit-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: var(--space-sm);
}

.login-form button:hover {
  background: var(--gcit-deep-teal);
}

.login-error {
  display: none;
  color: #e53e3e;
  font-size: 0.8125rem;
  margin-top: var(--space-sm);
}

.login-error.visible {
  display: block;
}

.login-footer {
  margin-top: var(--space-xl);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============ APP LAYOUT ============ */
.app {
  display: none;
  min-height: 100vh;
}

.app.active {
  display: flex;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--gcit-navy);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header .header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header .header-left img {
  height: 32px;
}

.header .header-title {
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0.95;
}

.header .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8125rem;
  opacity: 0.8;
}

.header .hosted-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255,255,255,0.1);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 100px;
  font-size: 0.75rem;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-lg) 0;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: var(--space-lg);
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-sm);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

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

.sidebar-link.active {
  background: var(--gcphn-teal-light);
  color: var(--gcit-primary);
  font-weight: 600;
  border-right: 3px solid var(--gcit-mint);
}

.sidebar-link .weight-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 100px;
}

.sidebar-link.active .weight-badge {
  background: var(--gcit-primary);
  color: white;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-sublinks {
  display: none;
}

.sidebar-sublinks.open {
  display: block;
}

.sidebar-sublink {
  display: block;
  padding: 0.35rem var(--space-lg) 0.35rem calc(var(--space-lg) + 26px);
  font-size: 0.775rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-sublink:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.sidebar-sublink.active {
  background: var(--gcphn-teal-light);
  color: var(--gcit-primary);
  font-weight: 600;
  border-left-color: var(--gcit-mint);
}

.sidebar-sublink .sub-id {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--gcit-deep-teal);
  margin-right: 4px;
}

/* Main content */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: var(--space-2xl) var(--space-2xl) var(--space-3xl);
  max-width: calc(var(--max-width) + var(--space-2xl) * 2);
  min-height: calc(100vh - var(--header-height));
}

/* ============ PAGE CONTENT ============ */

/* Page header */
.page-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--gcit-navy);
  margin-bottom: var(--space-xs);
}

.page-header .page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.page-header .criteria-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gcit-primary);
  background: var(--gcphn-teal-light);
  padding: var(--space-xs) var(--space-md);
  border-radius: 100px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.card-header .card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header .card-icon.blue { background: var(--info-bg); color: var(--gcit-primary); }
.card-header .card-icon.teal { background: var(--gcphn-teal-light); color: var(--gcit-deep-teal); }
.card-header .card-icon.green { background: var(--success-bg); color: var(--gcit-deep-teal); }
.card-header .card-icon.amber { background: #FFF5EB; color: var(--gcit-coral); }

.card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

.card p:last-child {
  margin-bottom: 0;
}

.card > img,
.card-header + img {
  max-height: 280px;
  object-fit: cover;
  width: 100%;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* Stat cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 500;
  color: var(--gcit-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--bg);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

tbody tr:hover {
  background: var(--bg);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.green { background: var(--success-bg); color: var(--success); }
.badge.blue { background: var(--info-bg); color: var(--info); }
.badge.amber { background: var(--warning-bg); color: var(--warning); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gcit-mint);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--gcit-mint);
}

.timeline-item.future::before {
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-item h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-item .timeline-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.timeline-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Certification grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.cert-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.cert-item .cert-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gcit-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.cert-item .cert-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cert-item .cert-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Callout boxes */
.callout {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
}

.callout.info {
  background: var(--info-bg);
  border-left: 3px solid var(--gcit-primary);
  color: var(--gcit-navy);
}

.callout.success {
  background: var(--success-bg);
  border-left: 3px solid var(--gcit-mint);
  color: var(--gcit-deep-teal);
}

.callout.teal {
  background: var(--gcphn-teal-light);
  border-left: 3px solid var(--gcit-primary);
  color: var(--gcit-deep-teal);
}

/* Process flow */
.process-flow {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-sm) 0;
}

.process-step {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  position: relative;
}

.process-step .step-num {
  width: 28px;
  height: 28px;
  background: var(--gcit-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  margin: 0 auto var(--space-sm);
}

.process-step .step-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.process-step .step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: left;
}

.accordion-trigger:hover {
  background: var(--bg);
}

.accordion-trigger .chevron {
  transition: transform 0.2s;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.accordion-item.open .accordion-trigger .chevron {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 0 var(--space-lg) var(--space-lg);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.accordion-item.open .accordion-content {
  display: block;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

/* Lists */
.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  padding: var(--space-sm) 0;
  padding-left: 28px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 18px;
  height: 18px;
  background: var(--gcphn-teal-light);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23147B8C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .main {
    padding: var(--space-lg);
  }
  .login-card {
    padding: var(--space-xl);
  }
  .process-flow {
    flex-direction: column;
  }
}

/* Print */
@media print {
  .sidebar, .header {
    display: none;
  }
  .main {
    margin: 0;
    padding: 1cm;
  }
}
