/* ============================================================
   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; }
}

/* ============================================================
   Frii rebrand — logo treatment (frii-logo.png is a wide wordmark:
   navy "frii" text + orange->purple gradient mark, transparent bg)
   ============================================================ */

/* Header sits on white — show the full-colour wordmark, constrain height. */
.brand img { height: 36px; width: auto; display: block; }

/* Footer is dark navy (var(--brand-navy)); the navy wordmark would disappear,
   so render the logo as a clean white silhouette on the dark footer. */
.footer-brand .brand-logo { filter: brightness(0) invert(1); height: 30px; }

/* Auth + dashboard brand marks (light backgrounds) keep full colour. */
.auth-brand img { height: 40px; width: auto; }
.dash-brand img { height: 30px; width: auto; }

/* ============================================================
   Menu motion polish + Lenis smooth scroll
   (adapted from the NextSaaS template's nav/motion feel)
   ============================================================ */

/* --- Lenis smooth-scroll required styles --- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* --- Animated dropdown caret: chevron flips up when the menu opens --- */
.primary-nav .caret { transition: transform .3s var(--ease), opacity .3s var(--ease); }
.primary-nav > li:hover > a .caret,
.primary-nav > li:hover > button .caret,
.primary-nav > li:focus-within > a .caret,
.primary-nav > li:focus-within > button .caret {
  transform: rotate(225deg); margin-top: 1px; opacity: .9;
}

/* --- Smoother, springier dropdown reveal (scale + slide) --- */
.mega {
  transform: translateX(-50%) translateY(-10px) scale(.985);
  transition: opacity .32s cubic-bezier(.2,.7,.2,1),
              transform .42s cubic-bezier(.16,1,.3,1) !important;
}
.primary-nav > li:hover .mega,
.primary-nav > li:focus-within .mega { transform: translateX(-50%) translateY(0) scale(1); }
.simple-dropdown {
  transform: translateX(-50%) translateY(-10px);
  transition: opacity .26s var(--ease), transform .36s cubic-bezier(.16,1,.3,1) !important;
}
.primary-nav > li:hover .simple-dropdown,
.primary-nav > li:focus-within .simple-dropdown { transform: translateX(-50%) translateY(0); }

/* --- Item hover: smooth fade + slide + icon pop (template feel) --- */
.mega-item { transition: background .3s var(--ease), color .3s var(--ease), transform .25s var(--ease); }
.mega-item:hover { transform: translateX(3px); }
.mega-item-icon { transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
.mega-item:hover .mega-item-icon { transform: scale(1.08) rotate(-3deg); }
.mega-card { transition: color .25s var(--ease), transform .25s var(--ease); }
.mega-card:hover { transform: translateX(3px); }
.simple-dropdown a { transition: background .25s var(--ease), color .25s var(--ease), padding-left .25s var(--ease); }
.simple-dropdown a:hover { padding-left: 16px; }

@media (prefers-reduced-motion: reduce) {
  .mega, .simple-dropdown, .mega-item, .mega-card, .primary-nav .caret { transition: none !important; }
}

/* ============================================================
   Homepage redesign — NextSaaS template look
   (light hero, pill eyebrows, rounded cards, pastel accents)
   ============================================================ */

/* ---------- Hero: modern two-column (text + floating 3D server) ---------- */
.hero--tpl {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fbfaff 0%, #f6f7fb 100%);
  padding: 64px 0 84px;
}
.hero--tpl .container { position: relative; z-index: 2; }
/* Soft gradient-mesh blobs behind everything */
.hero-mesh {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.hero-mesh::before, .hero-mesh::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
}
.hero-mesh::before { width: 520px; height: 520px; top: -160px; right: -80px;
  background: radial-gradient(circle, rgba(134,79,254,.45), transparent 70%); }
.hero-mesh::after { width: 420px; height: 420px; bottom: -180px; left: -120px;
  background: radial-gradient(circle, rgba(131,231,238,.40), transparent 70%); }

.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero--tpl .hero-content { max-width: 600px; text-align: left; margin: 0; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-l); color: var(--brand-h); border: 1px solid #e7defe;
  font-size: .8rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.hero--tpl .hero-content h1 {
  color: var(--ink); font-weight: 800; letter-spacing: -.025em;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 1.04; margin: 0 0 16px;
}
.hero--tpl .hero-content h1 .accent,
.hero--tpl .hero-content h1 span { color: var(--brand); }
.hero--tpl .hero-content > p {
  color: var(--muted); font-size: 1.08rem; line-height: 1.62; max-width: 540px; margin: 0 0 24px;
}
.hero--tpl .hero-content > p strong { color: var(--ink); }
.hero--tpl .hero-cta-row { justify-content: flex-start; }
.hero--tpl .hero-search-helper { margin-top: 16px; font-size: .82rem; color: var(--muted); }
.hero--tpl .search { margin-left: 0; margin-right: 0; }

/* Ghost button on the now-light hero must read dark, not white */
.hero--tpl .btn-ghost { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.hero--tpl .btn-ghost:hover { background: var(--surface-2) !important; color: var(--brand) !important; }

/* Trust avatars (gradient + initial) */
.hero-trust { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-avatars { display: inline-flex; }
.hero-avatars .av {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; margin-left: -10px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem;
  box-shadow: var(--shadow-sm); background: linear-gradient(135deg, var(--g1), var(--g2));
}
.hero-avatars .av:first-child { margin-left: 0; }
.hero-trust > span { font-size: .9rem; color: var(--muted); }
.hero-trust strong { color: var(--ink); font-weight: 700; }

/* Right column: floating 3D server + glowing globe + stat chips */
.hero-visual { position: relative; min-height: 420px; display: grid; place-items: center; }
.hero-visual .hero-orb {
  position: absolute; width: 118%; max-width: 660px; top: 50%; left: 52%;
  transform: translate(-50%, -52%); z-index: 0; opacity: .9; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
}
.hero-visual .hero-server {
  position: relative; z-index: 1; width: 100%; max-width: 500px; height: auto;
  filter: drop-shadow(0 40px 60px rgba(124,49,246,.22));
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: .82rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-md);
}
.hero-chip i { color: var(--brand); }
.hero-chip--uptime { top: 12%; left: -2%; animation: heroFloat 5s ease-in-out infinite; }
.hero-chip--ssl { bottom: 14%; right: 0; animation: heroFloat 7s ease-in-out infinite .5s; }
.hero-chip--ssl i { color: var(--brand-green-h); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero--tpl .hero-content { max-width: 100%; }
  .hero-visual { min-height: 280px; order: -1; }
  .hero-visual .hero-server { max-width: 360px; }
  .hero-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-server, .hero-chip { animation: none !important; }
}

/* ---------- Section eyebrows → pills ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); color: var(--brand-h); border: 1px solid var(--line);
  padding: 5px 13px; border-radius: 999px;
  font-size: .73rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ---------- Cards: rounder & softer (template feel) ---------- */
.product-card, .feature-card, .why-best-item, .pricing-card,
.form-card, .plan-options-card, .plan-summary, .mega { border-radius: 20px; }

/* ---------- Pricing: Monthly/Yearly toggle (services.html style) ---------- */
.price-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 auto 36px; }
.price-toggle .pt-opt { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: .98rem; transition: color .2s var(--ease); }
.price-toggle .pt-opt.is-active { color: var(--ink); }
.price-toggle .pt-save { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--brand-h); background: var(--brand-l); border: 1px solid #e7defe; padding: 3px 9px; border-radius: 999px; }
.pt-switch { position: relative; width: 54px; height: 30px; border-radius: 999px; border: 0; cursor: pointer; background: var(--ink); padding: 0; transition: background .25s var(--ease); }
.pt-switch .pt-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .28s cubic-bezier(.16,1,.3,1); }
.pt-switch[aria-pressed="true"] { background: var(--brand); }
.pt-switch[aria-pressed="true"] .pt-knob { transform: translateX(24px); }

/* ---------- Pricing cards: template polish ---------- */
.pricing-card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.pricing-card.is-popular { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-l), var(--shadow-lg); }
.pricing-card .badge-popular { background: var(--brand); color: #fff; font-size: .66rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; vertical-align: middle; margin-left: 6px; letter-spacing: .03em; text-transform: uppercase; }
.pricing-card .price { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.pricing-card .price .price-amount { font-size: 2.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.pricing-card .price .price-unit { font-size: .9rem; font-weight: 500; color: var(--muted); }
.pricing-grid.is-yearly .price-was { display: none; }
.pricing-card ul li > i:first-child,
.pricing-card ul li::before { color: var(--brand); }

/* ---------- Buttons: flat, no shadow/glow (incl. on hover) ---------- */
.btn-primary, .btn-primary:hover,
.btn-success, .btn-success:hover,
.btn-soft:hover { box-shadow: none !important; }
