/* ==========================================================================
   Design tokens, components & animations (complements the precompiled
   css/tailwind.css). This file is the master of global/base styling —
   daisyUI runs with `base: false` so it cannot fight these rules.

   Palette: teal. Red/orange read as "emergency"; an appliance repair is an
   annoyance, not a danger, and the customer is deciding who to let into their
   home. Teal reads clean/competent/trustworthy — and the domain is water.
   ========================================================================== */

/* --------------------------------------------------------------------------
   THE RULE FOR THIS PALETTE: any token used as a BACKGROUND under text needs a
   paired *-contrast token, and any token that inverts between themes needs its
   contrast token to invert with it.

   Tokens that invert (dark <-> light): --accent, --brand-2, --warn.
   Tokens that don't: --wa (WhatsApp brand green), --warn-bg.

   Note --warn vs --warn-bg: as a TEXT/border colour on a dark surface, warn must
   go light (#f87171). As a BACKGROUND under white text, it must stay dark
   (#b91c1c). One token cannot do both — white on #f87171 is 2.77:1.
   -------------------------------------------------------------------------- */
:root {
  --accent: #0f766e;          /* teal-700 — primary CTA. White text = 5.47:1 (AA) */
  --accent-600: #115e59;      /* teal-800 — hover */
  --accent-contrast: #ffffff; /* text ON --accent — see the .dark flip below */
  --brand-2: #1e3a8a;         /* deep blue — second tone, SMS button */
  --brand-2-contrast: #ffffff;/* text ON --brand-2 (10.36:1 here) */
  --spark: #f59e0b;           /* amber — promo, "open now", highlights */

  --warn: #b91c1c;            /* red — TEXT / borders (validation) */
  --warn-bg: #b91c1c;         /* red — BACKGROUND (error toast); never inverts */
  --warn-contrast: #ffffff;   /* text ON --warn-bg (6.47:1) */

  /* WhatsApp brand green. Fixed in both themes — it is a brand mark, not a
     theme colour. The label goes near-black: white on #25d366 is 1.98:1, which
     is what both reference projects ship on their single delivery path. */
  --wa: #25d366;
  --wa-600: #1fb457;
  --wa-contrast: #04211f;     /* 8.35:1 on --wa, 6.14:1 on --wa-600 */

  /* Light theme tokens */
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #e9eef0;
  --text: #0c1a1c;
  --text-muted: #4b6068;      /* on --surface = 6.8:1 (AA) */
  --border: #d9e2e5;
  --header-bg: rgba(255, 255, 255, 0.85);
}

html.dark {
  /* The accent INVERTS to a light tone here, so text on it must go near-black.
     Callme.ro/GottiCar never hit this because their accent is dark in both
     themes — white text always worked for them. Hardcoding text-white on
     .bg-accent here would give white-on-teal-400 at 1.9:1. Hence the token. */
  --accent: #2dd4bf;          /* teal-400 — on --bg = 10.0:1 (AAA) */
  --accent-600: #14b8a6;
  --accent-contrast: #04211f; /* CTA text goes near-black here (9.08:1) */
  --brand-2: #60a5fa;
  --brand-2-contrast: #071316;/* flips with --brand-2: white here is 2.54:1 */
  --spark: #fbbf24;
  --warn: #f87171;            /* text/border only — #b91c1c is unreadable here */
  /* --warn-bg / --warn-contrast / --wa* deliberately NOT overridden. */

  --bg: #071316;
  --surface: #0e1e22;
  --surface-2: #163035;
  --text: #f0f7f8;
  --text-muted: #93aeb5;      /* on --surface = 7.2:1 (AA) */
  --border: #1d383e;
  --header-bg: rgba(7, 19, 22, 0.80);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* --- Themed helper utilities ---------------------------------------------
   NAMING: the brand helpers are `*-brand`, not `*-accent`. daisyUI compiles its
   own `.btn-accent` / `.bg-accent` / `.text-accent` from its theme palette (in
   which `accent` is the amber --spark, not the teal). Same-name rules would
   then differ only by load order — styles.css happens to load after
   tailwind.css, so ours would win, but "correct because of <link> order"
   against a component library is a trap, and the two `accent`s meaning
   different colours is worse. `-brand` cannot collide: there is no `brand`
   colour in tailwind.config.js, so Tailwind emits nothing for it. */
.surface    { background-color: var(--surface); }
.surface-2  { background-color: var(--surface-2); }
.text-muted { color: var(--text-muted); }
.bd         { border-color: var(--border); }
.accent     { color: var(--accent); }   /* no Tailwind/daisyUI class of this name */
/* Always pair the brand background with its contrast token — never text-white. */
.bg-brand   { background-color: var(--accent); color: var(--accent-contrast); }
.text-warn  { color: var(--warn); }
.text-spark { color: var(--spark); }
/* Hides call-to-actions outside working hours (wins over responsive display). */
.cta-off    { display: none !important; }
.hover\:text-brand:hover   { color: var(--accent); }
.hover\:border-brand:hover { border-color: var(--accent); }

/* --- Brand wordmark (two-tone) ------------------------------------------- */
.brand-mark { letter-spacing: -0.02em; font-size: 1.18em; }
.brand-a    { color: var(--accent); }
.brand-b    { color: var(--brand-2); }
.hero .brand-b { color: #93c5fd; }   /* keep legible on the dark hero */
.brand-tm {
  font-size: 0.62em;
  font-weight: 700;
  vertical-align: super;
  margin-left: 1px;
  color: var(--accent);
  opacity: 0.85;
}

/* --- Language dropdown items (hover works on both themes) ---------------- */
.lang-menu { display: none; }
.lang-menu.open { display: block; }
.lang-item { color: var(--text); }
.lang-item .lang-endonym { color: var(--text-muted); }
.lang-item:hover,
.lang-item:focus-visible { background: var(--accent); color: var(--accent-contrast); }
.lang-item:hover .lang-endonym,
.lang-item:focus-visible .lang-endonym { color: var(--accent-contrast); }

/* --- Call button attention pulse ---------------------------------------- */
.btn-call { position: relative; animation: call-bounce 2.4s ease-in-out infinite; }
.btn-call::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.55);
  animation: call-ring 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes call-ring {
  0%   { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}
@keyframes call-bounce {
  0%, 88%, 100% { transform: translateY(0); }
  92%           { transform: translateY(-2px); }
  96%           { transform: translateY(-1px); }
}

/* --- Live availability dot (inside a daisyUI `badge`) -------------------- */
.badge-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; flex-shrink: 0; }
.badge-dot.pulse { animation: dot-pulse 1.8s ease-in-out infinite; }
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.75); }
}

/* --- Promo gift icon (distinct gold) ------------------------------------ */
.promo-gift { color: var(--spark); }

/* --- Header -------------------------------------------------------------- */
.site-header {
  background-color: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

/* --- Hero ---------------------------------------------------------------- */
/* img/hero.jpg is client-supplied; the gradient keeps the copy readable over
   whatever photo lands there. Until it exists the gradient alone still reads. */
.hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(4, 33, 31, 0.62), rgba(4, 33, 31, 0.80)),
    var(--brand-2) url("../img/hero.jpg") center 45% / cover no-repeat;
  color: #f0f7f8;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(4, 33, 31, 0.45) 0%, rgba(4, 33, 31, 0) 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

/* --- Buttons ------------------------------------------------------------- */
.btn-brand {
  background-color: var(--accent);
  color: var(--accent-contrast);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 8px 24px -10px rgba(15, 118, 110, 0.7);
}
.btn-brand:hover { background-color: var(--accent-600); box-shadow: 0 12px 30px -8px rgba(15, 118, 110, 0.65); }
.btn-brand:active { transform: scale(0.97); }

/* Ghost buttons only ever sit on the hero, which is dark in both themes. */
.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  transition: background-color 0.2s ease, transform 0.12s ease;
}
.btn-ghost:hover { background-color: rgba(255, 255, 255, 0.12); }
.btn-ghost:active { transform: scale(0.97); }

/* WhatsApp: brand green kept, label near-black. This is the button every lead
   goes through, so it is the last place to accept 1.98:1. */
.btn-wa { background: var(--wa); color: var(--wa-contrast); }
.btn-wa:hover { background: var(--wa-600); }
.btn-sms { background: var(--brand-2); color: var(--brand-2-contrast); }
.btn-sms:hover { filter: brightness(1.12); }

/* --- Cards --------------------------------------------------------------- */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.55);
}

/* --- "Ce reparăm" strip -------------------------------------------------- */
/* Sits right under the hero: it answers the only question the visitor has in
   the first two seconds ("does this solve MY problem?"). */
.fix-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fix-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.5); }

/* --- Form fields --------------------------------------------------------- */
.field {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}
html.dark .field:focus { box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25); }
.field.invalid { border-color: var(--warn); }

/* --- Tariff table -------------------------------------------------------- */
.tariff-table { width: 100%; border-collapse: collapse; }
.tariff-table th, .tariff-table td {
  text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
}
.tariff-table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.tariff-table td.price { font-weight: 800; color: var(--accent); white-space: nowrap; }
.tariff-table tr:last-child td { border-bottom: 0; }

/* FAQ accordion is daisyUI `collapse collapse-plus` (pure CSS, no JS). */

/* --- Brands marquee (pure CSS, duplicated track) ------------------------- */
.marquee { overflow: hidden; position: relative; }
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 6rem;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0;  background: linear-gradient(90deg, var(--surface-2), transparent); }
.marquee::after  { right: 0; background: linear-gradient(270deg, var(--surface-2), transparent); }
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* track is duplicated -> seamless */
}
.brand-item {
  flex: 0 0 auto;
  padding: 0.6rem 1.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.brand-item:hover { color: var(--accent); }

/* --- Testimonials carousel ---------------------------------------------- */
#tst-track > li { flex: 0 0 100%; box-sizing: border-box; padding: 0 0.5rem; }
@media (min-width: 768px)  { #tst-track > li { flex-basis: 50%; } }
@media (min-width: 1024px) { #tst-track > li { flex-basis: 33.3333%; } }
.tst-dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--border); transition: background 0.2s ease, width 0.2s ease; }
.tst-dot.active { background: var(--accent); width: 22px; }

/* --- Mobile nav ---------------------------------------------------------- */
#mobile-menu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
#mobile-menu.open { max-height: 560px; }

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop { background: rgba(4, 33, 31, 0.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.25s ease; }
.modal-backdrop.open { opacity: 1; }
.modal-card {
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.modal-backdrop.open .modal-card { transform: translateY(0) scale(1); opacity: 1; }

/* --- Cookie consent banner ---------------------------------------------- */
#cookie-banner:not(.hidden) { animation: cookie-up 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes cookie-up {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* --- Scroll-reveal micro-animation -------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Floating WhatsApp --------------------------------------------------- */
/* The icon inside is a graphic, so WCAG asks for 3:1 against the fill; white
   gives 1.98:1. --wa-contrast gives 8.35:1. */
.wa-fab {
  background: var(--wa);
  color: var(--wa-contrast);
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6);
  animation: wa-pulse 2.6s infinite;
}
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- Image gallery ------------------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px)  { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-item {
  position: relative; overflow: hidden; border-radius: 0.9rem; cursor: zoom-in;
  aspect-ratio: 4 / 3; border: 1px solid var(--border); background: var(--surface-2);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 33, 31, 0.45));
  opacity: 0; transition: opacity 0.3s ease;
}
.gallery-item:hover::after { opacity: 1; }

/* --- Lightbox ------------------------------------------------------------ */
.lightbox { background: rgba(4, 33, 31, 0.9); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.25s ease; }
.lightbox.open { opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 0.75rem; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); }
.lightbox-btn { background: rgba(255,255,255,0.12); color: #fff; transition: background 0.2s ease; }
.lightbox-btn:hover { background: rgba(255,255,255,0.25); }

/* --- Listing chip (OLX) -------------------------------------------------- */
/* Lucide has no OLX glyph, so this renders as a labelled pill rather than an
   obscure icon. For a Cluj sole trader OLX is a more serious lead channel than
   TikTok, so it earns an explicit label. */
.listing-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem;
  padding: 0.6rem 1.1rem; border-radius: 9999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.listing-chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* --- Social icons -------------------------------------------------------- */
.social-link { color: var(--text-muted); transition: color 0.2s ease, transform 0.2s ease; }
.social-link:hover { color: var(--accent); transform: translateY(-2px); }

/* --- ANPC badges --------------------------------------------------------- */
.anpc-img { max-height: 48px; width: auto; }

/* --- Discreet back-to-top ------------------------------------------------ */
.to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, color 0.2s ease;
}
.to-top.show { opacity: 0.7; visibility: visible; transform: none; }
.to-top.show:hover { opacity: 1; }

/* --- Scrollbar ----------------------------------------------------------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

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