/* ============================================================
   WHK CSS fixes — append after whk-modern.css
   Addresses contrast / visibility issues that surfaced after
   wiring more dynamic content (domain results, dynamic pricing
   tables, CTAs in lighter sections).
   ============================================================ */

/* ---------- .btn-ghost: was white-on-transparent (invisible on light bg) ---------- */
/* Default ghost button (on LIGHT backgrounds) */
.btn-ghost {
  background: transparent !important;
  color: var(--brand-magenta) !important;
  border: 1px solid var(--brand-magenta) !important;
}
.btn-ghost:hover {
  background: var(--brand-magenta) !important;
  color: #fff !important;
}

/* When ghost button is inside a dark hero / banner — keep it readable on dark bg */
.hero .btn-ghost,
.page-hero .btn-ghost,
.ai-hero .btn-ghost,
.moneyback .btn-ghost,
.promo-banner .btn-ghost,
.section-dark .btn-ghost {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.55) !important;
}
.hero .btn-ghost:hover,
.page-hero .btn-ghost:hover,
.ai-hero .btn-ghost:hover,
.moneyback .btn-ghost:hover,
.promo-banner .btn-ghost:hover,
.section-dark .btn-ghost:hover {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}

/* ---------- Buttons need visible focus ring ---------- */
.btn:focus, .btn:focus-visible {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 2px;
}

/* ---------- Domain search results — make register/transfer CTAs prominent ---------- */
.domain-result-action .btn {
  min-width: 110px;
  text-align: center;
  font-weight: 600;
}
.domain-result-action .btn-ghost {
  /* override for clarity: in results block, ghost = transfer */
  background: #fff !important;
  color: var(--brand-magenta) !important;
  border: 1px solid var(--brand-magenta) !important;
}
.domain-result-action .btn-ghost:hover {
  background: var(--brand-magenta) !important;
  color: #fff !important;
}

/* Badge in domain results */
.domain-result .badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  line-height: 1.4;
}
.domain-result .badge-success { background: #dcfce7; color: #0f7c4d; }
.domain-result .badge-warning { background: #fef3c7; color: #92400e; }
.domain-result .badge-muted   { background: #eef0f7; color: #6b7280; }

/* ---------- Buttons inside the dynamic pricing table ---------- */
.form-card table .btn-primary {
  white-space: nowrap;
}

/* ---------- Strike-through + accent price pairing in promo strip ---------- */
.promo-card .strike {
  text-decoration: line-through;
  opacity: .55;
  margin-right: 6px;
}
.promo-card .price-now {
  color: var(--brand-magenta);
  font-weight: 700;
}

/* ---------- Cart / Checkout / Auth pages — ensure form-card looks good ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  padding: 28px;
}

/* ---------- Misc inputs ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], input[type="url"],
input[type="number"], select, textarea {
  font-family: inherit;
}

/* ---------- Mobile fixes for domain results ---------- */
@media (max-width: 560px) {
  .domain-result {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .domain-result-tld, .domain-result-name {
    flex: 1 1 100%;
  }
  .domain-result-action {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* ============================================================
   Responsive + a11y fixes (May 2026 audit pass)
   ============================================================ */

/* Skip-to-content link — completely hidden until a keyboard user tabs to it.
   Uses the sr-only / "visually-hidden" clip technique so a stray mouse click
   near the top-left can never accidentally land on it and reveal the pill. */
.skip-to-content {
  position: absolute; left: 8px; top: 8px; z-index: 200;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
  background: var(--brand-magenta); color: #fff;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-to-content:focus-visible {
  width: auto; height: auto; padding: 10px 16px; margin: 0;
  overflow: visible; clip: auto; clip-path: none; white-space: normal;
  outline: 2px solid #fff; outline-offset: 2px;
}
#main-content:focus { outline: none; }

/* Mobile-panel close button (X) */
.mobile-panel-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mobile-panel-close:hover { background: #fff; color: var(--brand-magenta); }
.mobile-panel-close:focus-visible { outline: 2px solid var(--brand-magenta); outline-offset: 2px; }

/* iOS Safari zooms inputs whose computed font-size is < 16px. Force 16px on
   the mobile viewport for every interactive form control. */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="tel"], input[type="url"],
  input[type="number"], input[type="date"], input[type="time"],
  select, textarea {
    font-size: 16px !important;
  }
}

/* Minimum 44x44 touch targets on touch devices (WCAG 2.5.5). Exempt very
   small UI bits where 44px would distort layout (icon-only chips, tag pills). */
@media (max-width: 1024px) {
  .btn:not(.btn-sm):not(.tag):not(.chip) { min-height: 44px; }
  .auth-input { min-height: 44px; }
  .nav-actions .icon-btn { width: 44px; height: 44px; }
  .mobile-toggle { width: 44px; height: 44px; }
  .mobile-panel a { padding: 14px 8px; min-height: 44px; }
  .dash-menu-toggle { min-width: 44px; min-height: 44px; }
}

/* Container padding for very narrow phones (iPhone SE first-gen, Galaxy Fold front) */
@media (max-width: 380px) {
  .container { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .hero-content p, .page-hero p { font-size: 1rem; }
  .btn-lg { padding: 13px 22px; font-size: .95rem; }
}

/* Plan tabs — always allow horizontal scroll on touch */
@media (max-width: 900px) {
  .plan-tabs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .plan-tabs { width: max-content; flex-wrap: nowrap; }
}

/* Tables that can overflow — give them a horizontal-scroll envelope when the
   page didn't already provide one. */
.table-scroll, .responsive-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* Footer trust row: stack neatly on mobile instead of running off the side */
@media (max-width: 560px) {
  .footer-trust {
    flex-wrap: wrap; gap: 8px 10px; justify-content: flex-start;
  }
  .footer-trust small { font-size: .78rem; }
}

/* Dashboard sticky sidebar should sit below the (shorter) mobile topbar so it
   doesn't overlap it when slid open. */
@media (max-width: 860px) {
  .dash-sidebar { top: 0; height: 100vh; padding-top: 72px; }
  /* Sticky sub-panels (ticket sidebar, invoice side, service side, local aside)
     used --sticky-offset of 92px on desktop — too far down on mobile. */
  .local-aside, .ticket-sidebar, .service-side, .invoice-side {
    position: static !important;
  }
}

/* Dashboard tables: when the .dash-cards-mobile alternate exists, hide the
   table itself below 640px to avoid squashed columns. Pages that DON'T have a
   mobile-card alternative keep the scrollable table (better than nothing). */
@media (max-width: 640px) {
  .dash-table-wrap:has(+ .dash-cards-mobile) .dash-table { display: none; }
}

/* Footer payment row: wrap, don't overflow horizontally */
@media (max-width: 560px) {
  .payment-row { flex-wrap: wrap; gap: 6px; }
  .payment-row img { height: 22px; width: auto; }
}

/* Bump muted contrast for accessibility — 4.5:1 against #fff is borderline */
.muted-strong { color: #4a5070; font-weight: 600; }

/* Search button focus ring (high contrast against magenta) */
.search button:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}

/* Hero h1 should never be smaller than 1.7rem (ultra-narrow phones) */
@media (max-width: 360px) {
  .hero-content h1 { font-size: 1.85rem; line-height: 1.15; }
  h1 { font-size: 1.7rem; }
}

/* Cart grid: 2-col on desktop, single column on mobile */
.cart-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 720px) {
  .cart-grid { grid-template-columns: 1fr; gap: 18px; }
  .cart-grid aside { position: static; }
}
