/* =============================================
   MoneyConverter.ai — Main Stylesheet
   Professional Finance Theme
   Color Palette: White · Slate Gray · Navy Blue
============================================= */

/* --- CSS Variables --- */
:root {
  --navy:        #0B1F3A;
  --navy-mid:    #122848;
  --navy-light:  #1A3558;
  --blue:        #1D6FD8;
  --blue-hover:  #1558B0;
  --blue-light:  #EBF2FC;
  --accent:      #17C3A3;
  --white:       #FFFFFF;
  --off-white:   #F7F9FC;
  --gray-100:    #F0F4F8;
  --gray-200:    #E2E8F0;
  --gray-400:    #94A3B8;
  --gray-600:    #475569;
  --gray-800:    #1E293B;
  --text-main:   #1E293B;
  --text-muted:  #64748B;
  --border:      #E2E8F0;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(11,31,58,0.10), 0 1px 4px rgba(11,31,58,0.06);
  --shadow-lg:   0 12px 40px rgba(11,31,58,0.14), 0 2px 8px rgba(11,31,58,0.08);
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --transition:  all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans:   'DM Sans', system-ui, sans-serif;
  --font-serif:  'DM Serif Display', Georgia, serif;
  --max-width:   1180px;
  --header-h:    68px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--off-white);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--blue-hover); }
input, select, button { font-family: inherit; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   HEADER
============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--navy);
  color: white;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.logo-ai {
  color: var(--blue);
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: 0.1px;
}

.site-nav a:hover {
  color: var(--navy);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--navy);
  cursor: pointer;
  padding: 4px;
}

/* =============================================
   HERO SECTION
============================================= */
.hero {
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-light) 100%);
  padding: 72px 0 80px;
  overflow: hidden;
  position: relative;
}

/* Subtle grid texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
  position: relative;
  z-index: 1;
}

/* Hero Copy */
.hero-copy {
  color: white;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.18;
  color: white;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 28px;
  max-width: 400px;
  line-height: 1.65;
}

.hero-badges {
  list-style: none;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badges li {
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: 0.2px;
}

/* =============================================
   CONVERTER CARD
============================================= */
.converter-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.card-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Field Rows */
.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group--select {
  max-width: 160px;
  flex-shrink: 0;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.field-group input,
.field-group select {
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  background: var(--off-white);
  transition: var(--transition);
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(29,111,216,0.12);
}

.field-group input[readonly] {
  background: var(--gray-100);
  color: var(--blue);
  font-weight: 600;
  cursor: default;
  font-size: 17px;
}

/* Select custom arrow */
.field-group--select {
  position: relative;
}
.field-group--select::after {
  content: '▾';
  position: absolute;
  right: 12px;
  bottom: 14px;
  font-size: 14px;
  color: var(--gray-400);
  pointer-events: none;
}

/* Swap row */
.swap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
}

.rate-pill {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--gray-100);
  border-radius: 100px;
  padding: 6px 14px;
  flex: 1;
  text-align: center;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  letter-spacing: 0.1px;
}

.rate-pill.has-rate {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.swap-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.swap-btn:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

.swap-btn:active {
  transform: translateY(0);
}

/* Convert Button */
.convert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
}

.convert-btn:hover {
  background: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29,111,216,0.30);
}

.convert-btn:active {
  transform: translateY(0);
}

.convert-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.rate-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 0.1px;
}

/* =============================================
   AD ZONES
============================================= */
.ad-zone {
  padding: 16px 24px;
  margin: 32px auto;
}

.ad-placeholder {
  background: var(--gray-100);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* =============================================
   SECTION HEADER (shared)
============================================= */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-muted);
}

/* =============================================
   POPULAR PAIRS
============================================= */
.pairs-section {
  padding: 64px 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.pair-card {
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pair-card:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pair-flags {
  font-size: 22px;
  letter-spacing: 2px;
}

.pair-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.3px;
}

.pair-rate {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.pair-rate.loaded {
  color: var(--blue);
  font-weight: 600;
}

/* =============================================
   AFFILIATE SECTION
============================================= */
.affiliate-section {
  padding: 72px 0;
  background: var(--off-white);
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.aff-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.aff-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--text-main);
}

.aff-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.aff-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.aff-body p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.aff-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.1px;
}

.aff-card:hover .aff-cta {
  color: var(--blue-hover);
}

.affiliate-disclosure {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* =============================================
   TRUST SECTION
============================================= */
.trust-section {
  padding: 72px 0;
  background: var(--navy);
}

.trust-section .section-header h2 {
  color: white;
}

.trust-section .section-header p {
  color: rgba(255,255,255,0.6);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.trust-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: var(--transition);
}

.trust-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}

.trust-icon {
  font-size: 28px;
  margin-bottom: 14px;
  display: block;
}

.trust-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.trust-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
  background: var(--gray-800);
  padding: 52px 0 28px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 10px;
}

.footer-brand .logo-ai {
  color: var(--accent);
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 280px;
}

.footer-links h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}

.footer-bottom a {
  color: rgba(255,255,255,0.55);
}

.footer-bottom a:hover {
  color: white;
}

/* =============================================
   RESPONSIVE — TABLET (max 900px)
============================================= */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-copy {
    order: 1;
  }

  .converter-card {
    order: 2;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-badges {
    justify-content: center;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* =============================================
   RESPONSIVE — MOBILE (max 600px)
============================================= */
@media (max-width: 600px) {
  :root { --header-h: 60px; }

  .container { padding: 0 16px; }

  .site-nav { display: none; }

  .nav-toggle { display: block; }

  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 99;
    gap: 20px;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero-copy h1 {
    font-size: 1.75rem;
  }

  .converter-card {
    padding: 20px 16px 18px;
    border-radius: var(--radius);
  }

  .field-row {
    flex-direction: column;
    gap: 10px;
  }

  .field-group--select {
    max-width: 100%;
  }

  .swap-row {
    flex-direction: column-reverse;
    gap: 10px;
    align-items: stretch;
  }

  .swap-btn {
    justify-content: center;
    width: 100%;
    padding: 12px;
  }

  .rate-pill {
    text-align: center;
  }

  .pairs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .affiliate-grid {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ad-placeholder {
    height: 60px;
  }
}
