/* ===========================
   GLOBAL STYLES
=========================== */
:root {
  --navy: #1B3A6B;
  --navy-dark: #112548;
  --gold: #C9A84C;
  --gold-light: #E5C97A;
  --white: #FFFFFF;
  --off-white: #F4F7FB;
  --gray-light: #E8EDF5;
  --gray: #6B7280;
  --gray-dark: #374151;
  --text: #1F2937;
  --font-sans: 'Inter', 'Segoe UI', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(27,58,107,0.12);
  --shadow-lg: 0 8px 32px rgba(27,58,107,0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  /* Offset anchor targets so fixed nav doesn't cover them */
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
}

/* Reset button defaults */
button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  background: none;
}

/* Keyboard focus ring — only shows for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===========================
   NAVIGATION
=========================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

/* Enhanced shadow when page is scrolled */
nav.scrolled {
  box-shadow: 0 2px 24px rgba(27, 58, 107, 0.14);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.logo-text span {
  color: var(--gold);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-dark);
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
  display: block;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
  background: var(--gray-light);
}

/* CTA button in nav — overrides hover above */
.nav-cta {
  background: var(--navy) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
}

.nav-cta:hover {
  background: var(--navy-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.3) !important;
}

/* Hamburger menu icon */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.hamburger:hover {
  background: var(--gray-light);
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: block;
  transform-origin: center;
}

/* Hamburger animates to X when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  font-family: var(--font-sans);
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27, 58, 107, 0.35);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: #b8913e;
  border-color: #b8913e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.45);
}

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

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.25);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-outline-white:hover {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn-lg {
  padding: 17px 36px;
  font-size: 1.08rem;
}

/* ===========================
   SECTION LAYOUT
=========================== */
section {
  padding: 90px 32px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--navy);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 600px;
  line-height: 1.7;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* ===========================
   CARDS
=========================== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(27, 58, 107, 0.15);
}

/* ===========================
   PHOTO PLACEHOLDER
=========================== */
.photo-placeholder {
  background: linear-gradient(135deg, var(--gray-light) 0%, #dce5f0 100%);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px dashed #c4cfe0;
  overflow: hidden;
  position: relative;
}

.photo-placeholder svg {
  opacity: 0.4;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* ===========================
   VIDEO EMBED
=========================== */
/* Ensures iframe embeds are properly sized and rounded */
.video-wrapper iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ===========================
   FOOTER
=========================== */
footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 60px 32px 32px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer-col ul a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.87rem;
}

/* ===========================
   PAGE HERO (inner pages)
=========================== */
.page-hero {
  padding: 130px 32px 70px;
  background: linear-gradient(160deg, var(--navy) 0%, #2a5298 100%);
  color: var(--white);
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===========================
   FORM STYLES
=========================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-group label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gray-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 13px 16px;
  border: 2px solid var(--gray-light);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9CA3AF;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
}

/* Invalid field state */
.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .field-error {
  font-size: 0.82rem;
  color: #EF4444;
  font-weight: 500;
  display: none;
}

.form-group .field-error.visible {
  display: block;
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

/* Custom select arrow */
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
}

/* ===========================
   BADGE
=========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201, 168, 76, 0.12);
  color: #8B6914;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ===========================
   DIVIDER
=========================== */
.divider {
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  margin: 20px auto;
}

.divider-left {
  margin-left: 0;
}

/* ===========================
   SCROLL FADE-IN ANIMATION
   (Works on all pages via JS observer)
=========================== */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children inside grids/lists */
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ===========================
   RESPONSIVE — 1024px
=========================== */
@media (max-width: 1024px) {
  .nav-inner {
    padding: 0 24px;
  }
}

/* ===========================
   RESPONSIVE — 768px (tablet/mobile)
=========================== */
@media (max-width: 768px) {
  section {
    padding: 64px 20px;
  }

  .page-hero {
    padding: 110px 20px 56px;
  }

  /* Mobile nav drawer */
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 12px 20px 24px;
    border-bottom: 1px solid var(--gray-light);
    box-shadow: var(--shadow-md);
    gap: 2px;
    animation: slideDown 0.2s ease forwards;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 16px;
    width: 100%;
  }

  /* CTA in mobile nav takes full width */
  .nav-links li:last-child {
    margin-top: 8px;
  }

  .nav-links .nav-cta {
    display: block;
    text-align: center;
    border-radius: 10px !important;
  }

  .hamburger {
    display: flex;
  }

  /* Footer stacks vertically */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

/* ===========================
   RESPONSIVE — 480px (small mobile)
=========================== */
@media (max-width: 480px) {
  .btn-lg {
    padding: 15px 24px;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.7rem;
  }
}

/* ===========================
   SLIDE DOWN KEYFRAME
=========================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   NAV AUTH UI
=========================== */

/* "Sign In" link in nav */
.nav-signin-btn {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  padding: 8px 16px;
  border: 2px solid var(--navy);
  border-radius: 10px;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-signin-btn:hover {
  background: var(--navy);
  color: var(--white);
}

/* Logged-in user button */
.nav-user {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid var(--gray-light);
  border-radius: 10px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  transition: var(--transition);
}
.nav-user-btn:hover {
  border-color: var(--navy);
  background: var(--off-white);
}

.nav-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2a5298);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown menu */
.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.18s ease;
}
.nav-dropdown.open {
  display: block;
}

.nav-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-light);
  background: var(--off-white);
}
.nav-dropdown-fullname {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}
.nav-dropdown-email {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--gray-light);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s ease;
  text-decoration: none;
}
.nav-dropdown-item:last-child {
  border-bottom: none;
}
.nav-dropdown-item:hover {
  background: var(--off-white);
}
.nav-dropdown-signout {
  color: #DC2626;
}
.nav-dropdown-signout:hover {
  background: #fff0f0;
}

/* Mobile adjustments for auth nav elements */
@media (max-width: 1024px) {
  .nav-user-btn {
    border: none;
    padding: 8px 0;
    width: 100%;
    justify-content: flex-start;
  }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    margin-top: 8px;
    animation: none;
  }
  .nav-signin-btn {
    display: block;
    text-align: center;
  }
}
