/**
 * CouponNest - Modern & Simplified Design System
 * Theme: Light Green / Emerald (#10b981 / #059669) on crisp surfaces
 */

:root {
  /* Layout */
  --primary-rgb: 16, 185, 129;
  --action-bg: #047857;
  --card-max-width: 860px;
  --content-max-width: 1040px;
  --container-max-width: 1140px;
  --container-padding: clamp(1rem, 3vw, 1.75rem);

  /* Primary Emerald Palette */
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --primary-200: #bbf7d0;
  --primary-300: #86efac;
  --primary-400: #4ade80;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;

  /* Surfaces & Backgrounds */
  --bg-page: #f8faf9;
  --card-bg: #ffffff;
  --card-border: rgba(var(--primary-rgb), 0.20);
  --card-border-focus: #10b981;
  --border-subtle: #e2e8f0;

  /* Typography Colors (High Contrast WCAG AA/AAA Compliant) */
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #475569;
  --text-emerald: #065f46;

  /* Status Colors (form limits, badges) */
  --color-weak: #dc2626;
  --color-weak-bg: #fef2f2;
  --color-fair: #d97706;
  --color-fair-bg: #fffbeb;
  --color-good: #0284c7;
  --color-good-bg: #f0f9ff;
  --color-strong: #059669;
  --color-strong-bg: #ecfdf5;

  /* Radiuses */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 1px 3px rgba(0, 0, 0, 0.08);

  /* Fonts with system-ui fallbacks */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
  background: rgba(255, 255, 255, 0.96);
}

.header-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-600);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand:hover .brand-icon {
  background: var(--primary-700);
}

.brand-icon.small {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
}

.brand-logo-custom {
  max-height: 36px;
  max-width: 170px;
  object-fit: contain;
}

.brand-logo-custom.small {
  max-height: 24px;
  max-width: 120px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: var(--primary-700);
  background: var(--primary-50);
}

.nav-link.active {
  color: var(--primary-800);
  background: var(--primary-100);
  font-weight: 700;
}

.mobile-nav-toggle {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.45rem;
  cursor: pointer;
  line-height: 0;
}

/* ==========================================================================
   Main Layout & Shell
   ========================================================================== */
.main-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 1.5rem var(--container-padding) 4rem;
  width: 100%;
}

.page-container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.page-container--narrow {
  max-width: var(--card-max-width);
}

/* Page Intro & Typography */
.page-intro-header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding: 0.5rem 0 0.25rem;
}

.page-intro-header .eyebrow {
  display: none !important;
}

.eyebrow {
  display: block;
  color: var(--primary-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.page-title {
  font-size: clamp(2.1rem, 4.5vw, 2.85rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.22;
  margin: 0.5rem 0 1rem;
  overflow-wrap: anywhere;
}

.page-title em,
.page-title span {
  color: var(--primary-700);
  font-style: normal;
}

.page-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--primary-500);
  border-radius: 99px;
  margin: 1.1rem auto;
}

.page-lede,
.page-intro-header p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ==========================================================================
   Shared Cards
   ========================================================================== */
.content-card,
.rich-text-card,
.deal-card,
.store-card,
.category-card,
.article-card,
.empty-state,
.store-profile {
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4.5vw, 3.25rem);
  box-shadow: var(--shadow-card);
  margin-bottom: 2.25rem;
  transition: border-color 0.25s ease;
}

.deal-card,
.store-card,
.category-card,
.article-card,
.empty-state,
.store-profile {
  padding: 1.5rem;
  margin-bottom: 0;
}

.content-card:hover,
.rich-text-card:hover,
.deal-card:hover,
.store-card:hover,
.category-card:hover,
.article-card:hover {
  border-color: var(--primary-300);
}

.category-card,
.store-card,
.article-card {
  color: var(--text-main);
  text-decoration: none;
}

/* Headings inside content cards and blocks */
.content-card h2,
.content-block h2,
.rich-text-card h2,
.section-heading h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: var(--text-main);
  margin: 2.25rem 0 1rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  line-height: 1.3;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0.35rem 0 0;
}

.content-card h2::before,
.content-block h2::before,
.rich-text-card h2::before,
.section-heading h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.15em;
  background: var(--primary-500);
  border-radius: 99px;
  flex-shrink: 0;
}

.content-card h2:first-child,
.content-block h2:first-child,
.rich-text-card h2:first-child {
  margin-top: 0;
}

.content-block h3,
.rich-text-card h3,
.content-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.85rem 0 0.8rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.35;
}

.content-block h3::before,
.rich-text-card h3::before,
.content-card h3::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--primary-500);
  border-radius: 99px;
  flex-shrink: 0;
}

.content-block h3:first-child,
.rich-text-card h3:first-child,
.content-card h3:first-child {
  margin-top: 0;
}

/* Paragraphs & Typography inside rich cards */
.content-card p,
.rich-text-card p,
.content-block p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.content-card > p:first-of-type,
.rich-text-card > p:first-of-type {
  font-size: 1.08rem;
  line-height: 1.82;
  color: var(--text-main);
  font-weight: 450;
  margin-bottom: 1.75rem;
}

/* Custom Styled Lists */
.content-card ul,
.rich-text-card ul,
.content-block ul {
  padding-left: 0;
  list-style: none;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.content-card ul li,
.rich-text-card ul li,
.content-block ul li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.content-card ul li::before,
.rich-text-card ul li::before,
.content-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--primary-500);
  border-radius: 50%;
}

.content-card ol,
.rich-text-card ol,
.content-block ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.content-card ol li,
.rich-text-card ol li,
.content-block ol li {
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.rich-text-card table,
.content-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.rich-text-card th,
.rich-text-card td,
.content-card th,
.content-card td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.rich-text-card th,
.content-card th {
  background: var(--primary-50);
  color: var(--primary-900);
  font-weight: 700;
}

.rich-text-card code,
.content-card code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--primary-50);
  color: var(--primary-800);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.rich-text-card blockquote,
.content-block blockquote {
  background: var(--primary-50);
  border-left: 4px solid var(--primary-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.75;
}

.rich-text-card {
  overflow-wrap: anywhere;
}

.rich-text-card img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn,
.btn-primary,
.deal-button,
.cta-action-btn,
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--action-bg);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.btn-primary:hover,
.deal-button:hover,
.cta-action-btn:hover,
.submit-btn:hover {
  background: var(--primary-800);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--primary-700);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.cta-action-btn svg,
.submit-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* CTA Banner Card */
.cta-banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-50);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2.25rem;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.cta-banner-card:hover {
  border-color: var(--primary-300);
}

.cta-content h2,
.cta-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 0.3rem;
  letter-spacing: -0.015em;
}

.cta-content p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  background-color: var(--card-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
  background-color: var(--card-bg);
}

select,
select.form-control,
.select-styled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: calc(100% - 0.85rem) center !important;
  background-size: 16px 16px !important;
  padding-right: 2.35rem !important;
  cursor: pointer;
  line-height: 1.5;
}

select:hover,
select.form-control:hover,
.select-styled:hover {
  border-color: var(--primary-500);
  background-repeat: no-repeat !important;
  background-position: calc(100% - 0.85rem) center !important;
  background-size: 16px 16px !important;
}

select:focus,
select.form-control:focus,
.select-styled:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
  background-color: var(--card-bg) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: calc(100% - 0.85rem) center !important;
  background-size: 16px 16px !important;
}

select option,
select.form-control option {
  background-color: var(--card-bg);
  color: var(--text-main);
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
}

select:disabled,
select.form-control:disabled {
  background-color: var(--bg-page) !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 0.85rem) center !important;
  background-size: 16px 16px !important;
  cursor: not-allowed;
  opacity: 0.65;
}

textarea.form-control {
  min-height: 85px;
  resize: vertical;
}

.required {
  color: var(--color-weak);
  font-weight: 700;
  margin-left: 2px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-label,
.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-row-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.char-counter {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.char-counter.limit {
  color: var(--color-weak);
}

/* Search Box Component */
.coupon-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 0.35rem 0.35rem 0.35rem 0.75rem;
  border: 1.5px solid var(--primary-200);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.directory-tools .coupon-search {
  margin-top: 0;
}

.coupon-search:focus-within {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.coupon-search input {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

.coupon-search input:focus {
  outline: none;
}

.coupon-search input::placeholder {
  color: var(--text-light);
  opacity: 0.85;
}

.coupon-search input::-webkit-search-decoration,
.coupon-search input::-webkit-search-cancel-button,
.coupon-search input::-webkit-search-results-button,
.coupon-search input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.search-icon {
  flex-shrink: 0;
  color: var(--primary-700);
}

.coupon-search button,
.coupon-search .coupon-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-height: 42px;
  padding: 0.65rem 1.35rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--action-bg);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.coupon-search button:hover,
.coupon-search .coupon-search-btn:hover {
  background: var(--primary-800);
  box-shadow: var(--shadow-card);
}

.coupon-search button:active,
.coupon-search .coupon-search-btn:active {
  transform: translateY(1px);
}

.coupon-search button:focus-visible,
.coupon-search .coupon-search-btn:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

.text-link,
.detail-meta a,
.empty-state a {
  color: var(--primary-700);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover,
.detail-meta a:hover,
.empty-state a:hover {
  text-decoration: underline;
}

.text-link {
  font-size: 0.86rem;
}

.section-block {
  margin-top: 2.75rem;
}

/* ==========================================================================
   Ad Slots
   ========================================================================== */
.ad-slot-container {
  max-width: var(--content-max-width);
  margin: 0.5rem auto 0.75rem;
  padding: 0 var(--container-padding);
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.ad-placeholder-box {
  width: 100%;
  min-height: 64px;
  background: var(--primary-50);
  border: 1.5px dashed var(--primary-300);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem 0.65rem;
  position: relative;
  text-align: center;
}

.ad-native-box {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.ad-tag {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-content-inner p {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: 0.15rem;
}

.ad-content-inner small {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ==========================================================================
   Content Block, Features & FAQ
   ========================================================================== */
.content-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.faq-item.active {
  border-color: var(--primary-500);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem 1.25rem;
  background: var(--card-bg);
  border: none;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.faq-question:hover {
  background: var(--primary-50);
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-600);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
  background: var(--card-bg);
}

.faq-item.active .faq-answer {
  display: block;
}

/* ==========================================================================
   Contact Page - Split Support Desk Layout
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: stretch;
}

.contact-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.rail-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.rail-card:hover {
  border-color: var(--primary-300);
}

.rail-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.rail-card-title svg {
  color: var(--primary-600);
  flex-shrink: 0;
}

.rail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 0;
}

.rail-item + .rail-item {
  border-top: 1px solid var(--border-subtle);
}

.rail-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-100);
  color: var(--primary-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rail-item-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.1rem;
}

.rail-item-value {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-900);
  text-decoration: none;
  line-height: 1.4;
  word-break: break-word;
}

a.rail-item-value:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.rail-card-accent {
  background: var(--primary-50);
  border-color: var(--card-border);
}

.rail-promise {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.rail-promise-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rail-promise h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.rail-promise p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.rail-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rail-link:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.rail-link svg {
  color: var(--primary-400);
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.rail-link:hover svg {
  transform: translateX(3px);
  color: var(--primary-600);
}

.contact-form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.35rem 1.65rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.contact-form-card:hover {
  border-color: var(--primary-300);
}

.form-card-header {
  margin-bottom: 1rem;
}

.form-card-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.form-card-header h2 svg {
  color: var(--primary-600);
  flex-shrink: 0;
}

.form-card-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

.contact-form-card .captcha-field {
  width: 76px;
}

.contact-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.95rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--card-border);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.contact-privacy-note svg {
  color: var(--primary-600);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.contact-privacy-note strong {
  color: var(--primary-900);
}

.contact-cms-content {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.contact-cms-content p:last-child {
  margin-bottom: 0;
}

.contact-success {
  text-align: center;
  padding: 2.25rem 1rem 1.75rem;
}

.success-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.15rem;
  border-radius: 50%;
  background: var(--action-bg);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.contact-success h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.contact-success p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 430px;
  margin: 0 auto 1.5rem;
}

.full-width-btn {
  width: 100%;
}

.standard-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.captcha-card {
  background: var(--primary-50);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.1rem;
  box-shadow: var(--shadow-sm);
}

.captcha-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.captcha-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-900);
}

.captcha-title svg {
  color: var(--primary-600);
  width: 14px;
  height: 14px;
}

.captcha-subtext {
  font-size: 0.75rem;
  color: var(--primary-700);
  font-weight: 600;
}

.captcha-body {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.captcha-equation {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary-900);
  box-shadow: var(--shadow-sm);
}

.eq-op,
.eq-equals {
  color: var(--primary-600);
}

.captcha-field {
  width: 70px;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--primary-400);
  background: var(--card-bg);
  color: var(--primary-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.captcha-field:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.alert-box svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}


.alert-danger {
  background: var(--color-weak-bg);
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid rgba(var(--primary-rgb), 0.15);
  background: var(--card-bg);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.footer-simple-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-simple-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-simple-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.05rem;
}

.footer-divider {
  color: var(--text-light);
}

.footer-copyright {
  font-size: 0.84rem;
  color: var(--text-light);
}

.footer-simple-nav {
  display: flex;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.footer-simple-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-simple-nav a:hover {
  color: var(--primary-600);
}

.footer-mobile-copy-wrap {
  display: none;
}

/* Toast Notice */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary-900);
  color: #ffffff;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 200;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Accessibility: Visually Hidden for screen readers */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Intermediate Desktop/Tablet Nav Optimization */
@media (max-width: 1120px) and (min-width: 961px) {
  .nav-links {
    gap: 0.2rem;
  }
  .nav-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.84rem;
  }
}

/* ==========================================================================
   Responsive Media Queries (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 960px) {
  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
    z-index: 105;
  }

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

  .nav-link {
    width: 100%;
    padding: 0.6rem 0.85rem;
  }

  /* Footer Mobile */
  .footer-simple-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.85rem;
  }

  .footer-simple-left {
    justify-content: center;
  }

  .footer-desktop-copy,
  .footer-divider {
    display: none;
  }

  .footer-simple-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
  }

  .footer-mobile-copy-wrap {
    display: block;
  }
}

@media (max-width: 900px) {
  .cta-banner-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1.25rem;
  }

  /* Contact Page: stack form above info rail */
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-rail {
    order: 0;
    height: auto;
    justify-content: flex-start;
    gap: 1.25rem;
  }
}

@media (max-width: 600px) {
  .contact-form-card {
    padding: 1.25rem 1.15rem;
    border-radius: 16px;
  }

  .rail-card {
    padding: 1.15rem 1.2rem;
  }

  .contact-success {
    padding: 1.5rem 0.25rem 1rem;
  }

  .form-row-dual {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Global Keyboard Focus Accessibility (:focus-visible) */
:focus-visible {
  outline: 3px solid var(--primary-600) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 1000;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  top: 0.5rem;
}

/* page-content-section: uses homepage how-step-card classes.
   Ensure grid expands evenly and fills full section width */
.page-content-section .how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}

.page-content-section .how-step-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-content-section .how-step-card p {
  flex: 1;
}

@media (max-width: 900px) {
  .page-content-section .how-it-works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 540px) {
  .page-content-section .how-it-works-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
