/* ============================================================
   Contract-AI.ro — custom styles (beyond Tailwind utilities)
   ============================================================ */

:root {
  --navy-deep: #0F2942;
  --navy-steel: #1E3A5F;
  --gold-warm: #C9A961;
  --gold-light: #E5D4A1;
  --cream: #FAF8F5;
  --slate-text: #475569;
  --slate-dark: #1E293B;
  --slate-light: #94A3B8;
  --success-green: #059669;
  --error-red: #DC2626;
  --border-light: #E5E7EB;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--slate-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-serif { font-family: 'Playfair Display', Georgia, serif; }

/* ---- Focus-visible (WCAG AA) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold-warm);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Beta announcement banner ---- */
:root { --beta-h: 0px; }
body.has-beta { padding-top: var(--beta-h); }
body.has-beta .navbar { top: var(--beta-h); }

.beta-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; overflow: hidden;
  background:
    radial-gradient(120% 180% at 12% 0%, rgba(201,169,97,.18), transparent 55%),
    linear-gradient(90deg, var(--navy-deep) 0%, var(--navy-steel) 100%);
  border-bottom: 1px solid rgba(201, 169, 97, .35);
  box-shadow: 0 2px 14px rgba(15, 41, 66, .25);
}
.beta-inner {
  max-width: 80rem; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center;
}
.beta-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-deep);
  background: linear-gradient(180deg, var(--gold-light), var(--gold-warm));
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 6px rgba(201, 169, 97, .4);
}
.beta-pill .beta-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--navy-deep);
  animation: beta-pulse 2.4s ease-in-out infinite;
}
.beta-text { font-size: 13px; line-height: 1.35; color: var(--gold-light); margin: 0; }
.beta-text b { color: #fff; font-weight: 600; }
.beta-banner::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(229,212,161,.22) 50%, transparent 62%);
  transform: translateX(-120%); animation: beta-sheen 7s ease-in-out infinite;
}
@keyframes beta-sheen { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes beta-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 520px) { .beta-text { font-size: 12px; } .beta-inner { padding: 7px 14px; gap: 9px; } }
@media (prefers-reduced-motion: reduce) { .beta-banner::after { animation: none; display: none; } .beta-pill .beta-dot { animation: none; } }

/* ---- Navbar ---- */
.navbar {
  transition: background-color .35s ease, box-shadow .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.navbar.solid {
  background: rgba(15, 41, 66, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(15, 41, 66, .25);
  border-bottom-color: rgba(201, 169, 97, .22);
}

/* ---- Hero gradient ---- */
.hero-bg {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201,169,97,.10), transparent 60%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy-steel) 100%);
}
.hero-grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 70% 30%, black, transparent 75%);
}

/* ---- The animated A4 document ---- */
.paper {
  background: #fff;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
}
.doc-line {
  height: 9px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e9edf2, #f4f6f9);
  transform-origin: left center;
  opacity: 0;
}
.doc-line.short { width: 55%; }
.doc-line.accent { background: linear-gradient(90deg, var(--gold-warm), var(--gold-light)); height: 12px; }

.sig-path {
  fill: none;
  stroke: var(--navy-steel);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.seal {
  opacity: 0;
  transform: scale(0) rotate(-45deg);
}

/* ---- Scroll indicator ---- */
@keyframes nudge { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(8px); } }
.scroll-indicator { animation: nudge 1.8s ease-in-out infinite; }

/* ---- Cards ---- */
.cat-card, .doc-card, .feature-card {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.cat-card:hover, .feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 44px -22px rgba(15,41,66,.35);
  border-color: var(--gold-warm);
}
.doc-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 50px -24px rgba(15,41,66,.4);
  border-color: var(--gold-warm);
}
.doc-card:hover .doc-thumb-inner { transform: scale(1.06); }
.doc-thumb-inner { transition: transform .5s cubic-bezier(.2,.7,.2,1); }

/* ---- Steps connector ---- */
.step-line { stroke: var(--gold-warm); stroke-width: 2; stroke-dasharray: 6 6; }

/* ---- FAQ accordion ---- */
.faq-answer {
  overflow: hidden;
  height: 0;
  opacity: 0;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .35s ease; }

/* ---- CTA buttons tactile ---- */
.btn-gold {
  background: var(--gold-warm);
  color: var(--navy-deep);
  transition: transform .15s ease, box-shadow .3s ease, background-color .3s ease;
  box-shadow: 0 10px 24px -10px rgba(201,169,97,.6);
}
.btn-gold:hover { transform: scale(1.04); background: var(--gold-light); box-shadow: 0 16px 32px -10px rgba(201,169,97,.7); }
.btn-gold:active { transform: scale(.98); }

.btn-outline {
  border: 1.5px solid rgba(255,255,255,.55);
  color: #fff;
  transition: transform .15s ease, background-color .3s ease, border-color .3s ease;
}
.btn-outline:hover { transform: scale(1.04); background: rgba(255,255,255,.08); border-color: #fff; }
.btn-outline:active { transform: scale(.98); }

/* ---- Reveal base state (set by JS only if motion allowed) ---- */
.reveal { opacity: 1; }

/* ---- Testimonials float ---- */
.testi-card { transition: transform .35s ease, box-shadow .35s ease; }

/* ---- Document thumbnail patterns (abstract gold/navy) ---- */
.doc-pattern-a {
  background-image:
    radial-gradient(circle at 80% 20%, rgba(201,169,97,.35), transparent 45%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px);
}
.doc-pattern-b {
  background-image:
    radial-gradient(circle at 20% 80%, rgba(201,169,97,.30), transparent 50%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 12px);
}
.doc-pattern-c {
  background-image:
    radial-gradient(circle at 50% 30%, rgba(201,169,97,.28), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 16px);
}
.doc-pattern-a::after, .doc-pattern-b::after, .doc-pattern-c::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(transparent 55%, rgba(15,41,66,.55));
}
/* small doc glyph centered in thumbnails */
.doc-thumb-glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.9);
}

/* ---- Mobile drawer ---- */
.drawer {
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop { transition: opacity .35s ease; }

/* ---- Cookie banner ---- */
.cookie-banner { transition: transform .4s ease, opacity .4s ease; }
.cookie-banner.hidden-down { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* ---- Catalog filters ---- */
.filter-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem; cursor: pointer; font-size: 14px;
  color: var(--slate-text); border-radius: 8px;
  transition: color .2s ease;
}
.filter-row:hover { color: var(--slate-dark); }
.filter-row span { flex: 1; }
.filter-row b { font-weight: 600; font-size: 12px; color: var(--slate-light); }
.filter-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border: 1.5px solid var(--border-light);
  border-radius: 5px; display: grid; place-content: center; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.filter-row input[type="checkbox"]::before {
  content: ""; width: 10px; height: 10px; transform: scale(0);
  transition: transform .15s ease;
  background: var(--navy-deep);
  clip-path: polygon(14% 50%, 0 64%, 40% 100%, 100% 22%, 84% 8%, 38% 66%);
}
.filter-row input[type="checkbox"]:checked { background: var(--gold-warm); border-color: var(--gold-warm); }
.filter-row input[type="checkbox"]:checked::before { transform: scale(1); }

#filter-sidebar.mobile-open .filter-body { display: block; }

@media (max-width: 1023px) {
  .filter-body { display: none; }
  #filter-sidebar.mobile-open .filter-body { display: block; }
}

.line-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Multi-Step Wizard
   ============================================================ */
.wfield {
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--slate-dark);
  background: #fff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.wfield::placeholder { color: var(--slate-light); }
.wfield:focus { border-color: var(--gold-warm); box-shadow: 0 0 0 3px rgba(201,169,97,.15); }
.wfield.err { border-color: var(--error-red); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
textarea.wfield { resize: vertical; min-height: 84px; line-height: 1.6; }

/* progress */
#progress-track { height: 5px; background: var(--border-light); border-radius: 999px; overflow: hidden; }
#progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold-warm), var(--gold-light)); border-radius: 999px; transition: width .45s cubic-bezier(.4,0,.2,1); }

/* step dots */
.wdot { width: 9px; height: 9px; border-radius: 999px; background: var(--border-light); transition: all .3s ease; }
.wdot.active { background: var(--gold-warm); width: 28px; }
.wdot.done { background: var(--navy-steel); }

/* stage */
#stage-inner { position: relative; min-height: 280px; }
.wizard-step { width: 100%; }

/* iOS-style toggle */
.toggle-track {
  width: 46px; height: 28px; border-radius: 999px; background: var(--border-light);
  position: relative; flex-shrink: 0; transition: background-color .25s ease;
}
.toggle-track.on { background: var(--gold-warm); }
.toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.toggle-track.on .toggle-knob { transform: translateX(18px); }

/* dotted fill lines in preview */
.dotted-fill {
  display: inline-block; min-width: 110px; vertical-align: baseline;
  border-bottom: 1.5px dotted var(--slate-light); height: 1.1em;
}

/* the big partial toggle card on preflight */
#partial-card { transition: box-shadow .25s ease, background-color .25s ease; }

/* ============================================================
   FX: thematic background + button ripple
   ============================================================ */
.fx-layer {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.fx-glyph {
  position: absolute; display: block; color: var(--gold-warm);
  opacity: 0; will-change: transform, opacity;
}
.fx-glyph svg { width: 100%; height: 100%; display: block; }

/* Promote real content above the fx layer: mark the content
   wrapper with .fx-content (keeps decorative absolute layers untouched). */
.fx-content { position: relative; z-index: 1; }

.fx-btn { position: relative; overflow: hidden; }
.fx-ripple {
  position: absolute; border-radius: 9999px;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .fx-glyph { opacity: .06 !important; }
}

/* ============================================================
   Global "legal-tech" background field (fixed, behind content)
   ============================================================ */
#bg-fx {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.bgfx-grid {
  position: absolute; inset: -10%;
  background-image:
    linear-gradient(to right, rgba(30,58,95,.085) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,58,95,.085) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 45%, transparent 88%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 45%, transparent 88%);
}
.bgfx-grid::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(30,58,95,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,58,95,.10) 1px, transparent 1px);
  background-size: 230px 230px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 45%, transparent 88%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 45%, transparent 88%);
}
.bgfx-glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); will-change: transform;
}
.bgfx-glow.g1 { width: 560px; height: 560px; background: rgba(201,169,97,.28); top: -150px; left: -110px; }
.bgfx-glow.g2 { width: 520px; height: 520px; background: rgba(30,58,95,.22);  bottom: -170px; right: -100px; }
.bgfx-glow.g3 { width: 460px; height: 460px; background: rgba(201,169,97,.16); top: 42%; left: 52%; }
.bgfx-gly {
  position: absolute; color: var(--navy-steel);
  opacity: 0; will-change: transform, opacity;
}
.bgfx-gly.gold { color: var(--gold-warm); }
.bgfx-gly svg { width: 100%; height: 100%; display: block; }

/* Light sections become translucent so the field shows through;
   navy sections stay solid and cover it. */
.sec-cream { background: transparent !important; }
.sec-white { background: rgba(255,255,255,.62) !important; backdrop-filter: blur(2px); }

@media (prefers-reduced-motion: reduce) {
  .bgfx-gly { opacity: .045 !important; }
}

/* ---- Reduced motion: show everything, kill loops ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-indicator { animation: none; }
  .doc-line, .seal { opacity: 1 !important; transform: none !important; }
}
