/* ==========================================================================
   Eclipsed — componente homepage + Christmas UI (Modul 9 / 10)
   Header, navigație, bara de statistici, carduri, modalul de autentificare și
   sistemul unitar de decor (ghirlandă, becuri, ornamente de colț).
   Culorile vin din tokenii theme.css (Light/Dark). Animațiile folosesc doar transform/opacity
   și se opresc la prefers-reduced-motion și la FX „Lite".
   ========================================================================== */

/* ---------- Interacțiuni generale (toate temele) ---------- */
nav a { transition: color .22s ease, text-shadow .3s ease, transform .2s ease; background-image: linear-gradient(90deg, transparent, var(--theme-highlight), transparent); background-repeat: no-repeat; background-position: 50% calc(100% - 20px); background-size: 0 2px; }
nav a:hover, nav a:focus-visible { background-size: 78% 2px; color: var(--theme-highlight); text-shadow: 0 0 14px var(--theme-soft); outline: 0; transition: background-size .32s cubic-bezier(.2, .8, .2, 1), color .22s ease, text-shadow .3s ease, transform .2s ease; }
nav a:active { transform: scale(.96); }
nav a.active { background-size: 0 2px; }
nav a:focus-visible, .login-btn:focus-visible, .mode-toggle:focus-visible, .fx-toggle:focus-visible, .card:focus-visible, .hero-buttons a:focus-visible, .modal .close:focus-visible { outline: 2px solid var(--theme-highlight); outline-offset: 3px; }

.login-btn { position: relative; overflow: hidden; background-image: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%); background-repeat: no-repeat; background-size: 260% 100%; background-position: 130% 0; transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .3s ease, transform .2s ease, background-position .7s ease; }
.login-btn:hover { background-position: -30% 0; border-color: var(--theme-highlight); box-shadow: 0 0 0 1px var(--theme-soft), 0 6px 22px var(--theme-soft); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0) scale(.975); box-shadow: 0 0 0 1px var(--theme-soft); }
.mode-toggle:active, .fx-toggle:active { transform: scale(.94); }
.mode-toggle:hover { box-shadow: 0 6px 20px var(--theme-soft); }
.hero-buttons a { transition: transform .22s ease, box-shadow .3s ease, border-color .2s ease, filter .2s ease; }
.hero-buttons a:hover { transform: translateY(-2px); box-shadow: 0 10px 28px var(--theme-soft); }
.hero-buttons a:active { transform: translateY(0) scale(.98); }
.hero-buttons a span { display: inline-block; transition: transform .25s ease; }
.hero-buttons a:hover span { transform: translateX(4px); }

/* ---------- Statistici (toate temele) ---------- */
.stats { overflow: visible; padding: 22px 12px; }
.stats > div { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; padding: 4px 22px; border: 0; border-radius: 12px; opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1), background .3s ease; }
.stats.in > div { opacity: 1; transform: none; }
.stats.in > div:nth-child(2) { transition-delay: .09s, .09s, 0s; } .stats.in > div:nth-child(3) { transition-delay: .18s, .18s, 0s; } .stats.in > div:nth-child(4) { transition-delay: .27s, .27s, 0s; }
.stats > div + div::before { content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 1px; background: linear-gradient(to bottom, transparent, var(--theme-border), transparent); }
.stats > div::after { content: ""; position: absolute; inset: 0; border-radius: 12px; background: radial-gradient(120% 140% at 50% 120%, var(--theme-soft), transparent 70%); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.stats > div:hover::after { opacity: 1; }
.stats > div > .fx-ico { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--theme-border); border-radius: 13px; background: var(--theme-surface); color: var(--theme-highlight); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s ease, border-color .3s ease; }
.stats > div:hover > .fx-ico { transform: translateY(-2px) rotate(-6deg) scale(1.06); border-color: var(--theme-accent); box-shadow: 0 0 18px var(--theme-soft); }
.fx-ico svg { width: 22px; height: 22px; }
.stats > div b { align-self: end; font-variant-numeric: tabular-nums; }
.stats > div span:not(.fx-ico) { align-self: start; }
.stats > div:hover b { text-shadow: 0 0 16px var(--theme-soft); }

/* ---------- Carduri (toate temele) ---------- */
.card { isolation: isolate; background: var(--card-bg); box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .06); transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .35s ease; will-change: transform; }
.card:hover, .card:focus-visible { transform: translateY(-6px); border-color: var(--theme-highlight); box-shadow: 0 18px 40px rgba(0, 0, 0, .28), 0 0 0 1px var(--theme-soft), 0 0 30px var(--theme-soft); }
.card:active { transform: translateY(-2px) scale(.99); transition-duration: .12s; }
.card-icon { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--theme-border); border-radius: 15px; background: var(--theme-surface); font-size: 0; transition: border-color .3s ease, box-shadow .3s ease, background .3s ease; }
.card-icon svg { width: 26px; height: 26px; overflow: visible; transform-origin: 50% 80%; }
.card:hover .card-icon, .card:focus-visible .card-icon { border-color: var(--theme-accent); background: var(--theme-soft); box-shadow: 0 0 22px var(--theme-soft); }
.card h3 { transition: letter-spacing .35s ease, color .25s ease; }
.card:hover h3, .card:focus-visible h3 { letter-spacing: .12em; color: var(--theme-highlight); }
.card > span:not(.fx-corner) { transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background .25s ease, color .25s ease, box-shadow .3s ease; }
.card:hover > span:not(.fx-corner), .card:focus-visible > span:not(.fx-corner) { transform: translateX(3px) scale(1.12); background: var(--theme-accent); color: #fff; box-shadow: 0 0 18px var(--theme-soft); }
.card:active > span:not(.fx-corner) { transform: scale(.94); }
.card:hover .ico-team svg, .card:focus-visible .ico-team svg { animation: fxBob .8s ease-in-out infinite; }
.card:hover .ico-pin svg, .card:focus-visible .ico-pin svg { animation: fxDrop .9s cubic-bezier(.3, 0, .4, 1) infinite; }
.card:hover .ico-doc svg, .card:focus-visible .ico-doc svg { animation: fxTilt 1.1s ease-in-out infinite; }
.card:hover .ico-mail svg, .card:focus-visible .ico-mail svg { animation: fxRing .9s ease-in-out infinite; }
@keyframes fxBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px) scale(1.06); } }
@keyframes fxDrop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } 60% { transform: translateY(0) scaleY(.92); } }
@keyframes fxTilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 70% { transform: rotate(7deg); } }
@keyframes fxRing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } }

/* ==========================================================================
   SISTEMUL UNITAR DE DECOR (doar tema Crăciun)
   ========================================================================== */
/* vechiul decor (zăpadă + ghirlandă generică) nu se mai randează nicăieri */
.christmas-decor-layer { display: none !important; }

/* ghirlanda: element în afara fluxului, lipit de marginea de sus a componentei */
.fx-garland { position: absolute; z-index: 4; left: 0; top: -3px; width: 100%; pointer-events: none; transition: filter .4s ease; }
.fx-garland svg { display: block; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.fx-garnished { position: relative; }
.topbar.fx-garnished { position: fixed; }
.fx-b .fx-glow { animation: fxGlow 2.6s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes fxGlow { 0% { opacity: .12; } 100% { opacity: .42; } }
.topbar:has(nav a:hover, .login-btn:hover, .mode-toggle:hover) > .fx-garland { filter: brightness(1.25) saturate(1.25); }
.topbar:has(nav a:hover, .login-btn:hover, .mode-toggle:hover) .fx-b .fx-glow { animation-duration: 1.1s; }
.stats:hover > .fx-garland { filter: brightness(1.2) saturate(1.2); }

/* ornamente de colț pe cardurile din homepage */
.fx-corner { display: block; font-style: normal; position: absolute; z-index: 1; top: 0; right: 8px; width: 96px; height: 84px; pointer-events: none; }
.fx-corner::before { content: ""; position: absolute; inset: -30px -30px auto auto; width: 150px; height: 130px; background: radial-gradient(closest-side at 62% 38%, rgba(255, 214, 120, .22), transparent); opacity: .55; transition: opacity .45s ease, transform .6s ease; }
.card:hover .fx-corner::before, .card:focus-visible .fx-corner::before { opacity: 1; transform: scale(1.15); }
.fx-corner svg { position: relative; display: block; overflow: visible; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.fx-corner .sw { transform-box: fill-box; transform-origin: 50% 0; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.fx-corner .s3 { transform-origin: 100% 0; }
.card:hover .fx-corner .s1, .card:focus-visible .fx-corner .s1 { animation: fxSwing 1.9s ease-in-out infinite alternate; }
.card:hover .fx-corner .s2, .card:focus-visible .fx-corner .s2 { animation: fxSwing 1.5s ease-in-out -.4s infinite alternate; }
.card:hover .fx-corner .s3, .card:focus-visible .fx-corner .s3 { animation: fxSwing 2.4s ease-in-out infinite alternate; }
@keyframes fxSwing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.fx-corner .clap { transform-box: fill-box; transform-origin: 50% 0; }
.card:hover .fx-corner .clap { animation: fxClap .5s ease-in-out infinite alternate; }
@keyframes fxClap { from { transform: translateX(-2.2px); } to { transform: translateX(2.2px); } }
.card:hover .fx-corner .fx-b .fx-glow { animation-duration: 1s; }

/* ==========================================================================
   HEADER — Christmas (≥ 721px; pe mobil rămâne structura existentă)
   ========================================================================== */
@media (min-width: 721px) {
  html body[data-theme="christmas"] .topbar {
    height: 78px; padding: 0 20px 0 16px; border-radius: 22px; border: 1px solid var(--theme-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--glass) 86%, #fff 14%) 0, var(--glass) 55%);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -18px 30px rgba(0, 0, 0, .12);
    backdrop-filter: blur(20px) saturate(1.35); -webkit-backdrop-filter: blur(20px) saturate(1.35);
  }
  html body[data-theme="christmas"] .topbar .brand { min-width: 0; gap: 13px; padding: 14px 24px 0 4px; position: relative; }
  html body[data-theme="christmas"] .topbar .brand::after { content: ""; position: absolute; right: 0; top: 30%; bottom: 14%; width: 1px; background: linear-gradient(transparent, var(--line-strong), transparent); }
  html body[data-theme="christmas"] .topbar .brand img { box-sizing: border-box; width: 58px; height: 58px; padding: 6px; border: 1px solid var(--theme-border); border-radius: 18px; background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .13), rgba(255, 255, 255, .03)); box-shadow: 0 0 22px var(--theme-soft), inset 0 0 0 1px rgba(255, 255, 255, .04); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s ease; }
  html body[data-theme="christmas"] .topbar .brand:hover img { transform: rotate(-4deg) scale(1.05); box-shadow: 0 0 28px var(--theme-soft), 0 0 0 1px var(--theme-accent); }
  html body[data-theme="christmas"] .topbar .brand b { font-size: 10px; letter-spacing: .3em; color: var(--muted); }
  html body[data-theme="christmas"] .topbar .brand strong { font-size: 23px; line-height: 1.05; }
  html body[data-theme="christmas"] .topbar .brand em { font-size: 10.5px; letter-spacing: .32em; }

  html body[data-theme="christmas"] .topbar nav { height: auto; gap: 2px; margin-top: 14px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 15px; background: color-mix(in srgb, var(--surface-2) 52%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
  html body[data-theme="christmas"] .topbar nav a { height: 38px; padding: 0 clamp(8px, 1.05vw, 17px); border-radius: 11px; font-size: clamp(10.5px, .8vw, 12.5px); font-weight: 700; letter-spacing: .07em; white-space: nowrap; background-position: 50% calc(100% - 5px); transition: color .22s ease, background-color .25s ease, text-shadow .3s ease, transform .2s ease; }
  html body[data-theme="christmas"] .topbar nav a:hover, html body[data-theme="christmas"] .topbar nav a:focus-visible { background-color: color-mix(in srgb, var(--theme-soft) 55%, transparent); background-size: 56% 2px; }
  html body[data-theme="christmas"] .topbar nav a.active { color: var(--theme-highlight); background-color: var(--theme-soft); box-shadow: inset 0 0 0 1px var(--theme-border), 0 0 18px var(--theme-soft); background-size: 0 2px; }
  html body[data-theme="christmas"] .topbar nav a.active::after { left: 34%; right: 34%; bottom: 4px; height: 2px; border-radius: 2px; }

  html body[data-theme="christmas"] .topbar .account { min-width: 0; gap: 8px; margin-top: 14px; }
  html body[data-theme="christmas"] .topbar .mode-toggle, html body[data-theme="christmas"] .topbar .account .fx-toggle { box-sizing: border-box; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-strong); border-radius: 13px; background-color: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--text-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
  html body[data-theme="christmas"] .topbar .mode-toggle:hover, html body[data-theme="christmas"] .topbar .account .fx-toggle:hover { color: var(--theme-highlight); border-color: var(--theme-accent); background-color: var(--theme-soft); transform: translateY(-1px); }
  html body[data-theme="christmas"] .topbar .login-btn { height: 42px; padding: 0 20px; border: 1px solid rgba(255, 220, 150, .35); border-radius: 13px; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .09em; background-color: #a62339; background-image: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .24) 50%, transparent 65%), linear-gradient(135deg, #d13a52, #8f1f3b); background-size: 260% 100%, auto; background-position: 130% 0, 0 0; box-shadow: 0 6px 18px rgba(160, 30, 55, .38), inset 0 1px 0 rgba(255, 255, 255, .22); }
  html body[data-theme="christmas"] .topbar .login-btn:hover { background-position: -30% 0, 0 0; border-color: #ffd98a; box-shadow: 0 8px 24px rgba(200, 40, 70, .5), inset 0 1px 0 rgba(255, 255, 255, .28); }
  html body[data-theme="christmas"] .topbar .logged-user { height: 42px; border-radius: 13px; }
}
/* tabletă: două rânduri (brand + cont / navigație), ca pe mobil, ca să nu se strângă linkurile */
@media (min-width: 721px) and (max-width: 1100px) {
  html body[data-theme="christmas"] .topbar { height: auto; flex-wrap: wrap; row-gap: 8px; padding: 18px 18px 12px; }
  html body[data-theme="christmas"] .topbar .brand { flex: 1 1 auto; padding-top: 0; }
  html body[data-theme="christmas"] .topbar .brand::after { display: none; }
  html body[data-theme="christmas"] .topbar .account { margin-top: 0; flex: 0 1 auto; }
  html body[data-theme="christmas"] .topbar nav { order: 3; flex: 1 1 100%; margin-top: 0; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  html body[data-theme="christmas"] .topbar nav::-webkit-scrollbar { display: none; }
  html body[data-theme="christmas"] .topbar nav a { flex: none; font-size: 11.5px; padding: 0 12px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) nav a { padding: 0 9px; font-size: 11px; }
}
/* utilizator autentificat: contul ocupă mult loc, deci brandul și navigația se compactează ca să nu se taie linkurile */
@media (min-width: 721px) and (max-width: 1800px) {
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand { gap: 9px; padding-right: 14px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand img { width: 48px; height: 48px; padding: 4px; border-radius: 15px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand strong { font-size: 19px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand b, html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand em { font-size: 9px; letter-spacing: .2em; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) nav { gap: 0; padding: 3px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) nav a { padding: 0 7px; font-size: 10px; letter-spacing: .03em; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .account { gap: 6px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .quick-actions button { padding: 0 8px; font-size: 11px; }
}
@media (min-width: 721px) and (max-width: 1500px) {
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) nav a { padding: 0 5px; letter-spacing: 0; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand strong { font-size: 17px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .brand { padding-right: 10px; gap: 7px; }
  html body[data-theme="christmas"] .topbar:has(.logged-user:not(.hidden)) .quick-actions button { padding: 0 6px; }
}

/* ==========================================================================
   STATISTICI — Christmas: o singură componentă (container + ghirlandă + separatoare)
   ========================================================================== */
html body[data-theme="christmas"] .stats {
  padding: 36px 14px 22px; border: 1px solid var(--theme-border); border-radius: 20px;
  background: radial-gradient(120% 160% at 50% 0, color-mix(in srgb, var(--theme-soft) 45%, transparent), transparent 62%), linear-gradient(180deg, color-mix(in srgb, var(--glass) 90%, #fff 10%), var(--glass));
  box-shadow: 0 22px 50px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -22px 40px rgba(0, 0, 0, .16);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
html body[data-theme="christmas"] .stats > div + div::before { top: 8%; bottom: 8%; width: 9px; left: -4px; background: radial-gradient(circle 2.5px at 50% 50%, var(--theme-highlight) 96%, transparent) center / 9px 9px no-repeat, linear-gradient(to bottom, transparent, var(--theme-border) 22%, var(--theme-border) 78%, transparent) center / 1px 100% no-repeat; }
html body[data-theme="christmas"] .stats > div:hover::after { opacity: 1; }

/* ==========================================================================
   CARDURI HOMEPAGE — Christmas
   ========================================================================== */
html body[data-theme="christmas"] .cards .card { background: radial-gradient(130% 90% at 100% 0, color-mix(in srgb, var(--theme-soft) 55%, transparent), transparent 55%), var(--card-bg); }
html body[data-theme="christmas"] .cards .card::before { opacity: .55; }

/* ==========================================================================
   MODALUL DE AUTENTIFICARE — Christmas Portal
   ========================================================================== */
#loginModal .modal-box { position: relative; box-sizing: border-box; width: min(440px, calc(100vw - 32px)); padding: 48px 34px 30px; border: 1px solid var(--theme-border); border-radius: 26px; overflow: hidden; background: radial-gradient(110% 70% at 50% 0, color-mix(in srgb, var(--theme-soft) 55%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 8%), var(--surface)); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03), inset 0 1px 0 rgba(255, 255, 255, .09); animation: fxModalIn .45s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes fxModalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
#loginModal .modal-box .eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 11px; letter-spacing: .3em; color: var(--theme-highlight); }
#loginModal .modal-box .eyebrow::before { content: ""; width: 14px; height: 14px; background: var(--theme-highlight); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }
#loginModal .modal-box h2 { margin: 0 0 8px; font-family: "Playfair Display", serif; font-size: 32px; line-height: 1.1; }
#loginModal .modal-box > .muted { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
#loginModal .modal-box label { display: grid; gap: 8px; margin: 0 0 16px; color: var(--text-2); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
#loginModal .modal-box input { box-sizing: border-box; width: 100%; height: 50px; padding: 0 16px 0 46px; border: 1px solid var(--line-strong); border-radius: 14px; background-color: var(--field); background-repeat: no-repeat; background-position: 16px 50%; background-size: 18px; color: var(--text); font: 500 14.5px Inter, Arial, sans-serif; transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease; }
#loginModal #username { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b99a4a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7'/%3E%3C/svg%3E"); }
#loginModal #password { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b99a4a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='9.5' rx='2.4'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E"); }
#loginModal .modal-box input::placeholder { color: var(--muted); opacity: .8; }
#loginModal .modal-box input:hover { border-color: var(--theme-border); }
#loginModal .modal-box input:focus { outline: 0; border-color: var(--theme-highlight); background-color: color-mix(in srgb, var(--field) 85%, var(--theme-soft)); box-shadow: 0 0 0 4px var(--theme-soft); }
#loginModal .demo-hint { margin: 2px 0 20px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 50%, transparent); color: var(--muted); font-size: 11.5px; line-height: 1.55; }
#loginModal #doLogin { position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 52px; margin: 0; padding: 0 20px; border: 1px solid rgba(255, 220, 150, .4); border-radius: 15px; color: #fff; font: 800 13px Inter, Arial, sans-serif; letter-spacing: .1em; text-align: center; cursor: pointer; overflow: hidden; background-color: #a62339; background-image: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .26) 50%, transparent 65%), linear-gradient(135deg, #d63d55, #8f1f3b 70%, #6f1730); background-size: 260% 100%, auto; background-position: 130% 0, 0 0; box-shadow: 0 10px 26px rgba(160, 30, 55, .42), inset 0 1px 0 rgba(255, 255, 255, .24); transition: transform .2s ease, box-shadow .3s ease, background-position .7s ease, filter .2s ease, border-color .2s ease; }
#loginModal #doLogin:hover { background-position: -30% 0, 0 0; transform: translateY(-2px); border-color: #ffd98a; box-shadow: 0 14px 32px rgba(200, 40, 70, .55), inset 0 1px 0 rgba(255, 255, 255, .3); }
#loginModal #doLogin:active { transform: translateY(0) scale(.985); box-shadow: 0 6px 16px rgba(160, 30, 55, .4); }
#loginModal #doLogin:focus-visible { outline: 2px solid #ffd98a; outline-offset: 3px; }
#loginModal #doLogin:disabled { opacity: .55; filter: saturate(.55); cursor: not-allowed; transform: none; box-shadow: none; }
#loginModal #doLogin.is-loading { color: transparent; pointer-events: none; }
#loginModal #doLogin.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: fxSpin .7s linear infinite; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* butonul de închidere (toate modalurile) */
.modal-box > .close { position: absolute; z-index: 6; top: 16px; right: 16px; box-sizing: border-box; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); color: var(--text-2); font-size: 0; line-height: 0; cursor: pointer; transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease; }
.modal-box > .close::before, .modal-box > .close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.modal-box > .close::after { transform: rotate(-45deg); }
.modal-box > .close:hover { color: #fff; border-color: #e05a6c; background-color: #b92d45; box-shadow: 0 6px 18px rgba(185, 45, 69, .45); transform: rotate(90deg); }
.modal-box > .close:active { transform: rotate(90deg) scale(.9); }

/* ---------- Light mode ---------- */
html[data-mode="light"] .fx-garland svg { filter: drop-shadow(0 2px 2px rgba(40, 30, 20, .3)); }
html[data-mode="light"] .card:hover, html[data-mode="light"] .card:focus-visible { box-shadow: 0 16px 34px rgba(60, 40, 90, .16), 0 0 0 1px var(--theme-soft), 0 0 24px var(--theme-soft); }
html[data-mode="light"] body[data-theme="christmas"] .topbar { box-shadow: 0 14px 38px rgba(70, 50, 30, .22), inset 0 1px 0 rgba(255, 255, 255, .8); }
html[data-mode="light"] body[data-theme="christmas"] .stats { box-shadow: 0 18px 40px rgba(70, 50, 30, .18), inset 0 1px 0 rgba(255, 255, 255, .85); }
html[data-mode="light"] #loginModal .modal-box { box-shadow: 0 30px 70px rgba(60, 40, 30, .3), inset 0 1px 0 rgba(255, 255, 255, .9); }
html[data-mode="light"] .modal-box > .close { color: var(--text-2); }
html[data-mode="light"] .fx-corner svg { filter: drop-shadow(0 3px 3px rgba(60, 40, 30, .28)); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .stats > div { padding: 8px 14px; } .stats > div:nth-child(3)::before { display: none; } }
@media (max-width: 720px) {
  .stats > div { grid-template-columns: auto 1fr; padding: 8px 12px; } .stats > div + div::before { display: none; }
  .stats > div > .fx-ico { width: 38px; height: 38px; }
  .card:hover, .card:focus-visible { transform: translateY(-3px); }
  /* pe mobil decorul se simplifică, nu doar se micșorează: ghirlandă „mini”, un singur obiect per card */
  .fx-corner { right: 4px; width: 72px; height: 64px; } .fx-corner svg { width: 72px; height: 64px; } .fx-corner .wide { display: none; }
  html body[data-theme="christmas"] .stats { padding: 28px 8px 14px; border-radius: 16px; }
  #loginModal .modal-box { padding: 42px 22px 24px; border-radius: 22px; }
  #loginModal .modal-box h2 { font-size: 27px; }
  #loginModal .modal-box input { height: 48px; font-size: 16px; }   /* 16px: iOS nu mai face zoom la focus */
}
@media (max-width: 480px) { .topbar .brand { gap: 6px; } .topbar .brand img { width: 46px; height: 46px; } .topbar .brand strong { font-size: 16px; } .topbar .brand b { font-size: 10px; } .topbar .brand em { font-size: 11px; letter-spacing: 1.4px; } }
@media (hover: none) { .card:hover { transform: none; } .card:active { transform: scale(.985); } nav a:hover { background-size: 0 2px; } }

/* ---------- Mișcare redusă / FX Lite ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-b .fx-glow, .fx-corner .sw, .fx-corner .clap, .card-icon svg, #loginModal .modal-box { animation: none !important; }
  .stats > div { opacity: 1; transform: none; transition: none; }
  .card, .card:hover { transition-duration: .01s; transform: none; }
}
html[data-fx="lite"] .fx-b .fx-glow, html[data-fx="lite"] .fx-corner .sw, html[data-fx="lite"] .fx-corner .clap, html[data-fx="lite"] .card-icon svg { animation: none !important; }
html[data-fx="lite"] .fx-b .fx-glow { opacity: .3; }
