/* Imported Google Fonts matching USWDS standard typography */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - USWDS Standard & CBP Specifics */
  --color-primary-darker: #0c2340; /* Deep CBP Navy */
  --color-primary-dark: #1b365d;   /* Classic Navy */
  --color-primary: #005ea2;        /* USWDS Blue */
  --color-primary-light: #d9e8f6;  /* Soft Blue Tint */
  --color-neutral-dark: #1b1b1b;   /* Off-black Text */
  --color-neutral-light: #f0f4f7;  /* Neutral Background */
  --color-neutral-lightest: #fafafa;
  --color-accent-gold: #f2a900;    /* Freedom 250 Gold */
  --color-border: #adadad;
  --color-border-light: #dfe1e2;
  --color-success: #008837;
  --color-warning-bg: #fff3cd;
  --color-warning-border: #ffeeba;
  --color-warning-text: #856404;

  /* Fonts */
  --font-heading: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Grid/Layout */
  --max-width: 1200px;
  --sidebar-width: 280px;
}

/* Reset and Core Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-neutral-dark);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary-darker);
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.25;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: #002b49;
  text-decoration: none;
}

/* Utility Layout Classes */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Banner Styles
   ========================================================================== */

/* Federal Gov Banner */
.usa-banner {
  background-color: #000000;
  color: #ffffff;
  font-size: 12px;
  border-bottom: 1px solid #1b1b1b;
}

.usa-banner__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.usa-banner__header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.usa-banner__flag {
  width: 16px;
  height: 11px;
}

.usa-banner__text {
  color: rgba(255, 255, 255, 0.85);
}

.usa-banner__toggle-btn {
  background: none;
  border: none;
  color: #ffffff;
  text-decoration: underline;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.usa-banner__toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.usa-banner__toggle-btn svg {
  transition: transform 0.2s ease;
}

.usa-banner__toggle-btn.active svg {
  transform: rotate(180deg);
}

/* Federal banner expanded content */
.usa-banner__content {
  display: none;
  padding: 1rem 0;
  border-top: 1px solid #2d2d2d;
  background-color: #111111;
  color: #ffffff;
}

.usa-banner__content.active {
  display: block;
  animation: slideDown 0.3s ease-out;
}

.usa-banner__guidance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.usa-banner__guidance-item {
  display: flex;
  gap: 1rem;
}

.usa-banner__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.usa-banner__guidance-text strong {
  display: block;
  color: var(--color-primary-darker);
  margin-bottom: 0.25rem;
}

/* Freedom 250 Top Bar */
.freedom-250-bar {
  background: linear-gradient(90deg, #00111f 0%, #00223d 100%);
  color: #ffffff;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.freedom-250-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.freedom-250-bar__logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.freedom-250-bar__logo {
  height: 36px;
  width: 36px;
}

.freedom-250-bar__link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.freedom-250-bar__link:hover {
  text-decoration: underline;
}

.freedom-250-bar__countdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 13px;
  margin-left: auto;
}

.countdown-unit {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.2rem;
  background: none;
  padding: 0;
  border-radius: 0;
  min-width: auto;
  border: none;
}

.countdown-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.countdown-label {
  font-size: 12px;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.85);
}

/* CBP Brand Header */
.cbp-header {
  background-color: #000000;
  padding: 1.25rem 0 1rem 0;
  border-bottom: none;
}

.cbp-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cbp-header__brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
}

.cbp-header__logo-img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  transition: transform 0.3s ease;
}

.cbp-header__brand:hover .cbp-header__logo-img {
  transform: scale(1.02);
}

.cbp-header__brand-text h1 {
  font-size: 24px;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.cbp-header__brand-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cbp-header__search {
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 2px solid #ffffff;
  padding-bottom: 4px;
  width: 250px;
}

.cbp-header__search-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
  padding: 4px 30px 4px 0;
  transition: opacity 0.2s;
}

.cbp-header__search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.cbp-header__search-input:focus {
  outline: none;
}

.cbp-header__search-icon {
  position: absolute;
  right: 0;
  color: #ffffff;
}

/* Primary Navigation bar */
.cbp-nav {
  background-color: #000000;
  box-shadow: none;
}

.cbp-nav__inner {
  display: flex;
  justify-content: flex-start;
  list-style: none;
  border-bottom: 1px solid #1b1b1b;
}

.cbp-nav__item a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  margin-right: 2.25rem;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.cbp-nav__item a:hover {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.cbp-nav__item.active a {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.nav-chevron {
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s;
}

.cbp-nav__item a:hover .nav-chevron {
  color: #ffffff;
  transform: translateY(1px);
}

/* Mobile Nav Button */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  padding: 1rem;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* ==========================================================================
   Main Columns Structure
   ========================================================================== */

/* Breadcrumb Navigation */
.breadcrumbs {
  padding: 1.25rem 0 0.5rem 0;
  font-size: 13px;
  color: #5b616b;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  list-style: none;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumbs__item::after {
  content: "›";
  margin-left: 0.5rem;
  color: #adadad;
}

.breadcrumbs__item:last-child::after {
  content: "";
}

.breadcrumbs__item a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumbs__item a:hover {
  text-decoration: underline;
}

.breadcrumbs__item.active {
  color: var(--color-neutral-dark);
  font-weight: 500;
}

/* Two-column layout grid */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 2.5rem;
  padding: 1.5rem 0 4rem 0;
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */

.sidebar-nav {
  border-right: 1px solid var(--color-border-light);
  padding-right: 1rem;
}

.sidebar-nav__title {
  font-size: 15px;
  text-transform: uppercase;
  color: #5b616b;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--color-primary-darker);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav__item {
  position: relative;
}

.sidebar-nav__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #3d4551;
  font-weight: 500;
  font-size: 14px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav__link:hover {
  background-color: var(--color-neutral-light);
  color: var(--color-primary-darker);
}

.sidebar-nav__item.active > .sidebar-nav__link {
  font-weight: 700;
  color: var(--color-primary-darker);
  background-color: var(--color-primary-light);
}

.sidebar-nav__arrow {
  font-size: 11px;
  transition: transform 0.2s;
}

.sidebar-nav__item.expanded > .sidebar-nav__link .sidebar-nav__arrow {
  transform: rotate(90deg);
}

/* Sub lists */
.sidebar-nav__sublist {
  list-style: none;
  padding-left: 1.25rem;
  margin-top: 0.25rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 2px solid var(--color-border-light);
}

.sidebar-nav__item.expanded > .sidebar-nav__sublist {
  display: flex;
  animation: slideDown 0.25s ease-out;
}

.sidebar-nav__sublist .sidebar-nav__link {
  padding: 0.35rem 0.5rem;
  font-size: 13.5px;
  font-weight: 400;
}

.sidebar-nav__sublist .sidebar-nav__item.active > .sidebar-nav__link {
  color: var(--color-primary-darker);
  font-weight: 600;
  background-color: rgba(0, 94, 162, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  padding-left: calc(0.5rem - 3px);
}

/* ==========================================================================
   Main Content Panels
   ========================================================================== */

.content-panel {
  min-width: 0; /* Prevents flex/grid blowouts */
}

.content-panel h1 {
  font-size: 38px;
  letter-spacing: -1px;
  color: var(--color-primary-darker);
  border-bottom: 4px solid var(--color-accent-gold);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.intro-text {
  font-size: 18px;
  line-height: 1.55;
  color: #323a45;
  margin-bottom: 2rem;
}

/* Section dividers */
.content-panel h2 {
  font-size: 22px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 0.5rem;
  margin: 2.5rem 0 1.25rem 0;
}

.content-panel h3 {
  font-size: 17px;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content-panel p {
  margin-bottom: 1.25rem;
}

/* Instruction options styles */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.option-card {
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  padding: 1.5rem;
  background-color: var(--color-neutral-lightest);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.option-card h3 {
  color: var(--color-primary);
  margin-top: 0;
  font-size: 18px;
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.steps-list {
  list-style: none;
  counter-reset: steps-counter;
}

.steps-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  font-size: 14.5px;
}

.steps-list li::before {
  counter-increment: steps-counter;
  content: counter(steps-counter);
  position: absolute;
  left: 0;
  top: 2px;
  background-color: var(--color-primary-dark);
  color: #ffffff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: bold;
}

/* QR Code Section inside Card */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem auto 0 auto;
  padding: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background-color: #ffffff;
  max-width: 180px;
}

.qr-code-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.qr-label {
  font-size: 11px;
  color: #71767a;
  text-align: center;
  font-weight: 600;
}

/* Benefits Section list */
.benefits-list {
  list-style: none;
  margin-bottom: 2rem;
}

.benefits-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.benefits-list li::before {
  content: "✓";
  color: var(--color-success);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Alerts / Warnings boxes */
.usa-alert {
  background-color: var(--color-warning-bg);
  border-left: 4px solid var(--color-accent-gold);
  border-radius: 4px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-neutral-dark);
  font-size: 14.5px;
}

.usa-alert--important {
  background-color: #f4f6f8;
  border-left-color: var(--color-primary-dark);
  font-size: 14px;
  line-height: 1.5;
}

.usa-alert strong {
  color: var(--color-primary-darker);
}

/* Mailing addresses columns */
.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.address-card {
  border: 1px solid var(--color-border-light);
  border-top: 4px solid var(--color-primary-dark);
  border-radius: 0 0 6px 6px;
  padding: 1.5rem;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.address-card h4 {
  font-size: 15px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

.address-content {
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1.5;
  color: #323a45;
  white-space: pre-line;
}

.address-note {
  margin-top: 0.5rem;
  font-size: 12px;
  font-style: italic;
  color: #71767a;
}

/* General Lists on main body */
.bullet-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.bullet-list li {
  margin-bottom: 0.5rem;
  font-size: 15px;
}

/* Metadata footer signature */
.page-metadata {
  margin-top: 3rem;
  border-top: 1px solid var(--color-border-light);
  padding-top: 1rem;
  font-size: 13px;
  color: #71767a;
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.cbp-footer {
  background-color: var(--color-primary-darker);
  color: #ffffff;
  padding: 3rem 0 1.5rem 0;
  border-top: 4px solid var(--color-accent-gold);
}

.cbp-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cbp-footer__brand-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cbp-footer__seal-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: #ffffff;
}

.cbp-footer__seal {
  height: 50px;
  width: 50px;
}

.cbp-footer__seal-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.cbp-footer__brand-desc {
  font-size: 13px;
  color: #a9aeb1;
  max-width: 400px;
}

.cbp-footer__nav-col h4 {
  color: #ffffff;
  font-size: 15px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.25rem;
}

.cbp-footer__nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cbp-footer__nav-list a {
  color: #dfe1e2;
  text-decoration: none;
  font-size: 13.5px;
}

.cbp-footer__nav-list a:hover {
  text-decoration: underline;
  color: #ffffff;
}

.cbp-footer__bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cbp-footer__bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
}

.cbp-footer__bottom-links a {
  color: #a9aeb1;
  font-size: 12px;
  text-decoration: none;
}

.cbp-footer__bottom-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.cbp-footer__copyright {
  font-size: 12px;
  color: #a9aeb1;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

@media (max-width: 950px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar-nav {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }

  .cbp-footer__top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .cbp-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cbp-header__search {
    width: 100%;
  }

  .cbp-header__search-input {
    width: 100%;
  }

  .options-grid,
  .address-grid {
    grid-template-columns: 1fr;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .cbp-nav__inner {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .cbp-nav__inner.open {
    display: flex;
  }

  .cbp-nav__item a {
    padding: 0.75rem 1rem;
    border-bottom: none;
    border-left: 4px solid transparent;
  }

  .cbp-nav__item a:hover,
  .cbp-nav__item.active a {
    border-left-color: var(--color-accent-gold);
    border-bottom-color: transparent;
  }

  .usa-banner__guidance-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
