/* ===== Font Imports ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables (Esigodini Agricultural College Theme) ===== */
:root {
  --navy: #1a5632;          /* Deep Forest Green */
  --navy-light: #257a47;    /* Lighter Hover Green */
  --gold: #F9A825;          /* Harvest Amber/Gold */
  --bg-body: #F4F6F9;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-light: #e5e9f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.2s ease;
  --font-heading: 'Century Gothic', 'Tw Cen MT', 'URW Gothic L', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Native Background Image with Overlay (Index Page) ===== */
body.has-bg-image {
  background-color: #1f3d28; /* Dark green fallback */
  background-image: 
    linear-gradient(rgba(15, 30, 20, 0.78), rgba(15, 30, 20, 0.78)), /* The dark overlay */
    url('../images/img/crop.jpg'); /* The image */
  background-position: center center;
  background-size: cover;
  background-attachment: fixed; /* Smooth native parallax, highly performant */
  background-repeat: no-repeat;
}

/* ===== All Headings use Century Gothic ===== */
h1, h2, h3, h4, h5, h6,
.portal-hero h1,
.resource-section h2,
.action-card h3,
.resource-card h4,
.intake-name {
  font-family: var(--font-heading);
}

/* ===== Header / Navbar ===== */
.eac-topbar {
  background: var(--navy);
  color: #fff;
  padding: 10px 0;
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.5px;
  font-weight: 500;
  font-family: var(--font-body);
}
.eac-main-nav {
  background: #fff !important;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.eac-main-nav .navbar-brand { padding: 0; margin: 0; }
.eac-main-nav .navbar-brand img { height: 55px; width: auto; }
.eac-main-nav .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 700;
  padding: 8px 18px !important;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
  letter-spacing: -0.01em;
  font-family: var(--font-body);
}
.eac-main-nav .nav-link:hover, .eac-main-nav .nav-link.active {
  color: var(--navy) !important;
  background: #f0faf4;
}
.eac-main-nav .btn-staff {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  padding: 8px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  border: none;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  font-family: var(--font-body);
}
.eac-main-nav .btn-staff:hover { background: var(--navy-light); color: #fff; transform: scale(1.05); }
.navbar-light .navbar-toggler { border: none; padding: 5px; }
.navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2826, 86, 50, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Portal Layout ===== */
.portal-container { max-width: 1140px; margin: 0 auto; padding: 40px 20px; }

.portal-hero { text-align: center; margin-bottom: 40px; padding: 20px 0 10px; }
.portal-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 12px 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.portal-hero p {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* System Status Bar */
.system-bar {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: var(--shadow-md);
}
.status-left { display: flex; align-items: center; gap: 15px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px; font-weight: 600; font-size: 0.85rem;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.status-pill.open { background: #ecfdf5; color: #059669; }
.status-pill.closed { background: #fef2f2; color: #dc2626; }
.status-pill.upcoming { background: #eff6ff; color: #2563eb; }
.status-pill .dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }

.intake-name { font-weight: 600; color: var(--navy); font-size: 1rem; }

.progress-wrap { flex-grow: 1; min-width: 200px; margin: 0 20px; }
.progress-bg { height: 8px; background: #f0f0f0; border-radius: 50px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 50px; transition: width 0.5s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; font-weight: 500; }

.countdown-timer {
  display: flex; gap: 8px; font-weight: 600; color: var(--navy);
  background: #f0faf4; padding: 4px 14px; border-radius: 50px; font-size: 0.9rem; letter-spacing: 0.5px;
  font-family: var(--font-body);
}
.countdown-item { display: inline-flex; align-items: baseline; }
.countdown-number { font-weight: 800; font-size: 1.1rem; margin-right: 2px; min-width: 1.6em; text-align: center; font-family: var(--font-heading); }

/* Action Cards */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 60px; }
@media (max-width: 900px) { .action-grid { grid-template-columns: 1fr; } }

.action-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.action-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.action-card.primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  border: none;
}
.action-card.primary:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 15px 30px -8px rgba(26, 86, 50, 0.3);
}
.action-card .icon {
  width: 56px; height: 56px;
  background: #f4f6f9;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--navy);
  margin-bottom: 24px;
  transition: transform 0.2s;
}
.action-card:hover .icon { transform: scale(1.05); }
.action-card.primary .icon { background: rgba(255,255,255,0.15); color: var(--gold); }
.action-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.action-card p {
  margin: 0 0 28px 0;
  color: var(--text-muted);
  flex-grow: 1;
  line-height: 1.65;
  font-size: 1rem;
}
.action-card.primary p { color: rgba(255,255,255,0.8); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 28px; border-radius: 50px; font-weight: 600;
  text-decoration: none; transition: var(--transition); border: none;
  cursor: pointer; font-size: 1rem; width: auto; letter-spacing: 0.01em;
  font-family: var(--font-body);
}
.btn-gold { background: var(--gold); color: #1a1a1a; transition: background 0.2s, transform 0.2s; }
.btn-gold:hover { background: #e09800; transform: scale(1.02); color: #1a1a1a; }

/* Prominent Closed Button */
.btn-closed-prominent {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 22px 24px; font-size: 1.4rem; font-weight: 700;
  border-radius: 50px; background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9); border: 2px dashed rgba(255, 255, 255, 0.4);
  cursor: not-allowed; pointer-events: none; letter-spacing: 0.5px;
  font-family: var(--font-heading);
}

/* Inline Form */
.inline-form { display: flex; gap: 0; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 50px; padding: 4px; transition: border-color 0.2s, box-shadow 0.2s; }
.inline-form:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.1); }
.inline-form input {
  flex-grow: 1; border: none; padding: 10px 16px; font-size: 0.95rem;
  color: var(--text-primary); outline: none; background: transparent;
  font-family: var(--font-body);
}
.inline-form input::placeholder {
  color: #9ca3af; 
  opacity: 1;
}
.inline-form button {
  background: var(--navy); color: #fff; border: none; padding: 10px 24px;
  border-radius: 50px; font-weight: 600; cursor: pointer; transition: background 0.2s;
  font-family: var(--font-body);
}
.inline-form button:hover { background: var(--navy-light); }
.form-help { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* Resource Grid (Full Width Section) */
.resource-section {
  background: #fff;
  border-top: 1px solid var(--border-light);
  padding: 50px 0 60px;
  margin-top: 40px;
  width: 100%;
}
.resource-section h2 {
  text-align: center; color: var(--navy); font-size: 1.75rem;
  font-weight: 700; margin-bottom: 40px; letter-spacing: -0.02em;
}
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .resource-grid { grid-template-columns: 1fr; } }

.resource-card {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.resource-card h4 {
  display: flex; align-items: center; gap: 12px; color: var(--navy);
  font-size: 1.2rem; margin: 0 0 20px 0; font-weight: 700; letter-spacing: -0.01em;
}
.resource-card h4 i { color: var(--gold); font-size: 1.4rem; }
.resource-list { list-style: none; padding: 0; margin: 0; }
.resource-list li {
  display: flex; gap: 12px; margin-bottom: 14px; font-size: 0.92rem;
  color: var(--text-secondary); line-height: 1.55;
}
.resource-list li i { color: var(--navy); margin-top: 3px; font-size: 1rem; }

/* ===== Footer ===== */
.portal-footer { background: var(--navy); color: #cbd5e1; padding: 30px 0; }
.portal-footer .footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.portal-footer p { margin: 0; color: #94a3b8; font-size: 0.9rem; font-family: var(--font-body); }
.portal-footer a { color: #fff; text-decoration: none; font-weight: 500; font-size: 0.9rem; font-family: var(--font-body); }
.portal-footer a:hover { text-decoration: underline; }

/* ===== Flash Messages ===== */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; border: 1px solid transparent; font-weight: 500; font-family: var(--font-body); }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

/* ===== Forms & Inputs (Global) ===== */
.form-control, .form-select {
  width: 100%; padding: 12px 16px; border-radius: 8px;
  border: 1px solid var(--border-light); font-size: 1rem;
  transition: var(--transition); background: #fff;
  font-family: var(--font-body);
}
.form-control:focus, .form-select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.1); outline: none; }

.form-control::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.form-label { 
  font-size: 0.85rem; 
  font-weight: 600; 
  color: var(--navy); 
  margin-bottom: 4px; 
  font-family: var(--font-body); 
}
.required-label::after { content: " *"; color: #dc2626; font-weight: 700; }

/* ===== Green & Gold Helpers ===== */
.bg-navy { background-color: var(--navy) !important; }
.text-navy { color: var(--navy) !important; }
.btn-navy { background-color: var(--navy); color: #fff; border: none; transition: var(--transition); font-family: var(--font-body); }
.btn-navy:hover { background-color: var(--navy-light); color: #fff; }
.btn-outline-navy { color: var(--navy); border: 1px solid var(--navy); background: transparent; transition: var(--transition); font-family: var(--font-body); }
.btn-outline-navy:hover { background-color: var(--navy); color: #fff; }

/* ===== Modern Step Progress Tracker ===== */
.step-progress-modern {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 15px 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.progress-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  flex-wrap: nowrap;
  gap: 0;
}
.progress-connector {
  position: absolute;
  top: 28px;
  left: 0;
  height: 3px;
  background: var(--navy);
  transition: width 0.5s ease;
  z-index: 0;
  border-radius: 4px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
  cursor: default;
}
.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  font-family: var(--font-heading);
}
.step-dot.active .step-number {
  background: var(--navy);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(249, 168, 37, 0.3);
  transform: scale(1.05);
}
.step-dot.completed .step-number {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.step-dot.pending .step-number {
  background: #f8f9fa;
  color: #adb5bd;
  border-color: #dee2e6;
}
.step-label {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  font-family: var(--font-body);
}
.step-dot.active .step-label { color: var(--navy); font-weight: 700; }
.step-dot.completed .step-label { color: var(--gold); }

/* ===== Form Step Transitions ===== */
.form-step { animation: fadeSlide 0.3s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Invalid Fields ===== */
.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.2);
}

/* ===== File Upload Preview ===== */
.upload-box .file-name { font-size: 0.85rem; }

/* ===== Responsive Tweaks ===== */
@media (max-width: 768px) {
  .system-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .status-left { justify-content: space-between; }
  .progress-wrap { margin: 0; }
  .countdown-timer { font-size: 0.8rem; padding: 4px 10px; }
  .countdown-number { font-size: 1rem; min-width: 1.4em; }
  .action-card { padding: 24px; }
}

@media (max-width: 600px) {
  .step-number { width: 32px; height: 32px; font-size: 0.8rem; }
  .step-label { font-size: 0.6rem; margin-top: 4px; }
  .progress-connector { top: 24px; }
}