/**
 * Google-Style Minimalist Landingpage CSS
 * Clean White Aesthetic, WCAG 2.1 AA Accessibility, Zero CLS, Responsive Design
 */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-main: #202124;
  --text-muted: #595d62; /* 5.1:1 contrast on white (WCAG AA compliant) */
  --text-light: #444746; /* 8.2:1 contrast on white */
  --border-color: #dfe1e5;
  --border-hover: #dadce0;
  --accent-gold: #c5a059;
  --accent-gold-dark: #8c6819; /* High-contrast gold for accessible text */
  --shadow-normal: 0 1px 3px rgba(32, 33, 36, 0.08);
  --shadow-hover: 0 1px 6px rgba(32, 33, 36, 0.22);
  --shadow-focus: 0 2px 10px rgba(32, 33, 36, 0.16);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
}

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

html, body {
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--text-main);
  color: #ffffff;
  padding: 10px 18px;
  z-index: 10000;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--accent-gold);
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.top-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 24px;
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
  padding: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-main);
  text-decoration: underline;
  outline: 2px solid var(--accent-gold);
  border-radius: 4px;
}

/* Main Search Container */
.main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 50px 20px;
  text-align: center;
}

.hero-visual-wrapper {
  margin-bottom: 16px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual {
  width: 220px;
  height: 220px;
  aspect-ratio: 1 / 1;
  max-width: 80vw;
  max-height: 80vw;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  filter: drop-shadow(0 4px 14px rgba(197, 160, 89, 0.15));
}

.question-pretitle {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.question-title {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.question-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 520px;
  line-height: 1.5;
}

/* Google-Style Search Form */
.search-form-wrapper {
  width: 100%;
  max-width: 584px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-normal);
  border-radius: 28px;
  height: 52px;
  padding: 0 18px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.search-bar:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.search-bar:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow-focus);
}

.search-icon {
  color: #70757a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text-main);
  background: transparent;
  letter-spacing: 0.02em;
}

.search-input::placeholder {
  color: #70757a;
  font-weight: 400;
}

.clear-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.clear-btn:hover,
.clear-btn:focus-visible {
  color: var(--text-main);
  background: #f1f3f4;
  outline: none;
}

/* Location Badge Chip */
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 16px;
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2328;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.location-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-gold-dark);
}

/* Action Buttons (Google Style) */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.google-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-secondary);
  color: #3c4043;
  font-family: inherit;
  font-size: 14px;
  padding: 0 18px;
  height: 42px;
  min-width: 44px;
  line-height: 40px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.google-btn:hover,
.google-btn:focus-visible {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  background-color: #f8f9fa;
  border-color: var(--border-hover);
  color: #202124;
  outline: 2px solid var(--accent-gold);
}

.google-btn.primary {
  font-weight: 600;
}

/* Quick Region Pills */
.quick-regions {
  margin-top: 36px;
  max-width: 680px;
}

.quick-regions-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 14px;
}

.pills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.quick-pill {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 13px;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-pill:hover,
.quick-pill:focus-visible {
  background-color: #f8f9fa;
  border-color: var(--accent-gold-dark);
  color: #202124;
  outline: 2px solid var(--accent-gold);
}

/* Footer */
.google-footer {
  background-color: #f2f2f2;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid #dadce0;
}

.footer-top {
  padding: 12px 24px;
  border-bottom: 1px solid #dadce0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.footer-bottom {
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links button,
.footer-links a {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.footer-links button:hover,
.footer-links button:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text-main);
  text-decoration: underline;
  outline: 2px solid var(--accent-gold);
  border-radius: 4px;
}

/* Redirect Overlay */
.redirect-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.25s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent-gold-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

.redirect-message {
  font-size: 17px;
  color: var(--text-main);
  line-height: 1.6;
}

.region-highlight {
  color: var(--accent-gold-dark);
  font-weight: 700;
}

/* Modals */
dialog {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 28px;
  max-width: 620px;
  width: 90vw;
  margin: auto;
  font-family: inherit;
  color: var(--text-main);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.dialog-header h3 {
  font-size: 19px;
  font-weight: 600;
}

.dialog-close-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dialog-close-btn:hover,
.dialog-close-btn:focus-visible {
  color: var(--text-main);
  background: #f1f3f4;
  outline: 2px solid var(--accent-gold);
}

.dialog-content {
  font-size: 14px;
  line-height: 1.7;
  color: #3c4043;
}

/* Utilities */
.hidden {
  display: none !important;
}

.shake-error {
  animation: shake 0.4s ease;
  border-color: #d93025 !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 600px) {
  .hero-visual {
    width: 170px;
    height: 170px;
  }
  .hero-visual-wrapper {
    min-height: 170px;
  }
  .question-title {
    font-size: 2.5rem;
  }
  .search-bar {
    height: 48px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .review-snippets-grid {
    grid-template-columns: 1fr;
  }
}

/* Visible Customer Trust & Reviews (Google Rich Results Compliance) */
.trust-signals {
  margin-top: 40px;
  max-width: 680px;
  width: 100%;
  text-align: center;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 18px;
}

.rating-badge .stars {
  color: #fbbc04; /* Google Star Gold */
  letter-spacing: 2px;
  font-size: 14px;
}

.rating-badge .rating-val {
  font-weight: 700;
  color: var(--text-main);
}

.rating-badge .rating-count {
  color: var(--text-muted);
}

.review-snippets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
}

.user-quote {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-light);
  box-shadow: 0 1px 2px rgba(32, 33, 36, 0.04);
}

.user-quote p {
  margin-bottom: 8px;
  font-style: italic;
}

.user-quote cite {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold-dark);
  font-style: normal;
  display: block;
}
