/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

/* Design tokens */
:root {
  /* New color palette */
  --text-primary: #6369D1;
  --bg-cream: #FFFEF7;
  --bg-white: #FFFFFF;
  
  /* Accent colors */
  --accent-warm: #CB9173;
  --accent-blue: #6369D1;
  --accent-yellow: #F3DFA2;
  --accent-sky: #BFD7EA;
  
  /* Neutrals */
  --grey-light: #F5F4F0;
  --grey-medium: #D8D6D0;
  --grey-dark: #B0AEA5;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(11, 32, 39, 0.05);
  --shadow-md: 0 4px 12px rgba(11, 32, 39, 0.08);
  --shadow-lg: 0 8px 24px rgba(11, 32, 39, 0.12);
  
  /* Borders & Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, .title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.title {
  font-size: 24px;
  margin-bottom: 4px;
}

.headline {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.desc {
  font-weight: 300;
  line-height: 1.5;
  opacity: 0.85;
}

.muted {
  color: var(--text-primary);
  opacity: 0.6;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--grey-medium);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98);
}

.header .title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

/* Navigation */
.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width 0.2s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 2px solid var(--grey-medium);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--grey-dark);
}

/* Program Grid (Dashboard) */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.program-card {
  padding: 32px;
  border-radius: var(--radius-xl);
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.program-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.program-card.blue {
  background: var(--accent-blue);
  color: white;
}

.program-card.blue .desc {
  color: rgba(255, 255, 255, 0.9);
}

.program-card.warm {
  background: var(--accent-warm);
  color: white;
}

.program-card.warm .desc {
  color: rgba(255, 255, 255, 0.9);
}

.program-card.yellow {
  background: var(--accent-yellow);
  color: var(--text-primary);
}

.program-card.yellow .desc {
  opacity: 0.8;
}

.program-card.sky {
  background: var(--accent-sky);
  color: var(--text-primary);
}

.program-card.sky .desc {
  opacity: 0.8;
}

.program-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.program-card .headline {
  font-family: var(--font-display);
  margin-bottom: 12px;
}

.program-card .desc {
  margin-bottom: 20px;
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

.btn.primary {
  background: var(--text-primary);
  color: white;
}

.btn.primary:hover {
  background: #1a3a42;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.secondary {
  background: var(--grey-light);
  color: var(--text-primary);
}

.btn.secondary:hover {
  background: var(--grey-medium);
}

.program-card .btn {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.program-card.blue .btn,
.program-card.warm .btn {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
}

.program-card.yellow .btn,
.program-card.sky .btn {
  background: var(--text-primary);
  color: white;
  border: none;
}

.program-card .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.program-card.yellow .btn:hover,
.program-card.sky .btn:hover {
  background: #1a3a42;
}

/* Forms - Global styles for all input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 14px 18px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-family: var(--font-body) !important;
  transition: all 0.2s ease !important;
  background: var(--bg-white) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af !important;
}

/* Override any existing form styles */
.searchbar input,
.card input,
form input,
input {
  padding: 14px 18px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  transition: all 0.2s ease !important;
}

.searchbar input:focus,
.card input:focus,
form input:focus,
input:focus {
  outline: none !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  opacity: 0.7;
}

/* Pills/Tags */
.pill {
  display: inline-block;
  padding: 6px 14px;
  background: var(--grey-medium);
  color: var(--text-primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin: 2px;
  transition: all 0.2s ease;
  border: 1px solid var(--grey-dark);
}

.pill:hover {
  background: var(--accent-sky);
  border-color: var(--accent-sky);
  transform: translateY(-1px);
}

.pill.active {
  background: var(--accent-blue);
  color: white;
}

.pill.small {
  padding: 4px 10px;
  font-size: 12px;
}

/* Search Bar */
.searchbar {
  background: var(--accent-blue) !important;
  border: none !important;
  padding: 28px !important;
  margin-bottom: 24px;
}

.searchbar input {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  padding: 14px 20px;
  font-size: 16px;
}

.searchbar .btn {
  padding: 14px 28px;
  font-size: 15px;
}

/* Candidate Cards */
.candidate-card {
  transition: all 0.2s ease;
  cursor: pointer;
}

.candidate-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.candidate-card.active {
  background: var(--accent-sky);
  border-color: var(--accent-blue);
}

.candidate-card .title {
  font-family: var(--font-display);
  font-size: 20px;
}

.candidate-card .title a {
  color: var(--text-primary);
  text-decoration: none;
}

.candidate-card.active .title a {
  color: var(--text-primary);
}

/* Notes */
.note {
  padding: 16px;
  background: var(--grey-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

/* History */
.history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-light);
}

.history-item:last-child {
  border-bottom: none;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  /* Container & Layout */
  .container {
    padding: 0 12px;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  body {
    overflow-x: hidden;
    font-size: 14px;
  }
  
  /* Header */
  .header {
    padding: 12px 0;
    position: relative;
  }
  
  .header .title {
    font-size: 18px;
  }
  
  .header .row {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  /* Navigation */
  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .nav a {
    font-size: 12px;
    padding: 6px 10px;
    background: var(--grey-light);
    border-radius: 8px;
    flex: 0 1 auto;
  }
  
  /* Grids */
  .program-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Rows - always stack on mobile */
  .row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch !important;
  }
  
  .row > * {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  
  /* Cards */
  .card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }
  
  .program-card {
    padding: 24px;
  }
  
  /* Typography */
  .title {
    font-size: 20px;
  }
  
  .headline {
    font-size: 24px;
  }
  
  /* Buttons */
  .btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }
  
  /* Pills/Tags */
  .pill {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  /* Forms */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 12px 14px !important;
  }
  
  /* Search bar */
  .searchbar {
    padding: 20px !important;
  }
  
  .searchbar .row {
    flex-direction: column;
  }
  
  .searchbar input {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* Candidate cards */
  .candidate-card .title {
    font-size: 18px;
  }
  
  .candidate-card:hover {
    transform: none;
  }
  
  /* Two-column layouts become single column */
  [style*="flex: 1"],
  [style*="flex: 1.5"],
  [style*="flex: 2"] {
    flex: 1 1 100% !important;
  }
  
  /* Sticky elements */
  [style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
  .container {
    padding: 0 10px;
  }
  
  .header {
    padding: 10px 0;
  }
  
  .nav a {
    font-size: 11px;
    padding: 5px 8px;
  }
  
  .card {
    padding: 14px;
  }
  
  .program-card {
    padding: 20px;
  }
  
  .title {
    font-size: 18px;
  }
  
  .headline {
    font-size: 20px;
  }
  
  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Special accent backgrounds */
.card[style*="--lav"],
.card[style*="--peach"],
.card[style*="--sand"],
.card[style*="--blue"] {
  border: none;
}

/* Override inline styles for new palette */
[style*="background: var(--lav)"] {
  background: var(--accent-sky) !important;
}

[style*="background: var(--peach)"] {
  background: var(--accent-warm) !important;
  color: white !important;
}

[style*="background: var(--sand)"] {
  background: var(--accent-yellow) !important;
}

[style*="background: var(--blue)"] {
  background: var(--accent-blue) !important;
  color: white !important;
}

/* Login page specific */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-cream);
}

.login-card {
  background: var(--bg-white);
  padding: 48px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-card .title {
  font-family: var(--font-display);
  font-size: 32px;
  text-align: center;
  margin-bottom: 32px;
}

/* Login page mobile */
@media (max-width: 768px) {
  .login-container {
    padding: 20px;
  }
  
  .login-card {
    padding: 32px 24px;
    max-width: 100%;
  }
  
  .login-card .title {
    font-size: 26px;
    margin-bottom: 24px;
  }
}

@media (max-width: 576px) {
  .login-card {
    padding: 28px 20px;
  }
  
  .login-card .title {
    font-size: 22px;
    margin-bottom: 20px;
  }
}