/* Componente reutilizabile: header, butoane, uși de calendar, taburi, formulare, footer. */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 26, 46, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-0);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--red-500);
  box-shadow: 0 2px 0 var(--red-700);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}
.nav-toggle {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.site-nav {
  display: none;
  position: absolute;
  inset: 100% 0 auto 0;
  padding: var(--space-4);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.site-nav.is-open { display: block; }
.site-nav ul { display: flex; flex-direction: column; gap: var(--space-1); }
.nav-link {
  display: block;
  font-family: var(--font-display);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg-2); color: var(--text-0); }
.nav-link[aria-current="page"] { color: var(--gold-300); background: var(--bg-2); }
.site-nav .btn { margin-top: var(--space-2); width: 100%; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    padding: 0;
    background: none;
    border: 0;
  }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--space-1); }
  .nav-link { padding: var(--space-2) var(--space-3); }
  .nav-link[aria-current="page"] { background: none; }
  .site-nav .btn { margin: 0 0 0 var(--space-3); width: auto; }
}

/* ---------- Butoane ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 50px;
  padding: 0 var(--space-6);
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--red-500); color: #fff; box-shadow: 0 4px 0 var(--red-700); }
.btn-primary:hover { background: #e2475a; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 0 var(--red-700); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-700); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: var(--text-0); background: rgba(255, 255, 255, 0.06); }
.btn-ghost:hover { border-color: var(--gold-300); color: var(--gold-300); transform: translateY(-2px); }
.btn-small { min-height: 40px; padding: 0 var(--space-4); font-size: 0.95rem; }
.btn-block { width: 100%; }

/* ---------- Butoane social media ---------- */
.social-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.social-btn {
  --btn: var(--red-500);
  --btn-shadow: var(--red-700);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
  border-radius: 999px;
  background: var(--btn);
  box-shadow: 0 4px 0 var(--btn-shadow);
  color: #fff;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.social-btn:nth-child(2) { --btn: var(--green-500); --btn-shadow: var(--green-900); }
a.social-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 0 var(--btn-shadow); }
a.social-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow); }
/* Logoul, afișat în alb, într-un cerc ușor mai deschis */
.social-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.social-icon img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.social-btn strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.social-btn small { display: block; color: rgba(255, 255, 255, 0.88); font-size: var(--text-xs); }
.social-btn.is-unset { background: transparent; box-shadow: none; border: 2px dashed var(--border-strong); color: var(--text-1); }
.social-compact .social-btn { min-height: 46px; padding: var(--space-1) var(--space-4) var(--space-1) var(--space-1); gap: var(--space-2); }
.social-compact .social-icon { width: 36px; height: 36px; }
.social-compact .social-icon img { width: 19px; height: 19px; }
.social-compact .social-btn small { display: none; }

.promo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-12);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--green-700);
  border-color: transparent;
}
.promo-strip p { color: var(--text-1); }
.promo-strip strong { color: var(--text-0); }

/* ---------- Ușile calendarului ---------- */
.doors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
@media (min-width: 520px) { .doors { grid-template-columns: repeat(6, 1fr); gap: var(--space-3); } }
.doors-wide { grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (min-width: 520px) { .doors-wide { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .doors-wide { grid-template-columns: repeat(6, 1fr); gap: var(--space-4); } }

.door {
  --leaf: var(--red-500);
  --leaf-dark: var(--red-600);
  --num: #fff;
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  /* ce se vede în spatele ușii: lumină caldă */
  background: radial-gradient(circle at 50% 55%, #fff3c4, var(--gold-500) 75%);
  box-shadow: 0 4px 0 rgba(3, 10, 22, 0.35);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.door:nth-child(5n + 2) { --leaf: var(--green-500); --leaf-dark: var(--green-700); }
.door:nth-child(5n + 3) { --leaf: var(--cream); --leaf-dark: #f1dfc0; --num: var(--red-600); }
.door:nth-child(5n + 4) { --leaf: var(--red-600); --leaf-dark: var(--red-700); }
.door:nth-child(5n + 5) { --leaf: var(--green-700); --leaf-dark: var(--green-900); }

/* Cele două canaturi ale ușii, fiecare cu mâner auriu */
.door::before, .door::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 0;
  transition: transform var(--dur-med) var(--ease-bounce);
}
.door::before {
  left: 0; transform-origin: left;
  background: radial-gradient(circle at 86% 56%, var(--gold-300) 0 2.5px, transparent 3.5px), linear-gradient(180deg, var(--leaf), var(--leaf-dark));
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}
.door::after {
  right: 0; transform-origin: right;
  background: radial-gradient(circle at 14% 56%, var(--gold-300) 0 2.5px, transparent 3.5px), linear-gradient(180deg, var(--leaf), var(--leaf-dark));
}

.door-num {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding-bottom: 12%;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 6vw, 2rem);
  font-weight: 700;
  color: var(--num);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.door-state {
  position: absolute;
  right: 6px; bottom: 6px;
  z-index: 3;
  width: 16px; height: 16px;
  color: var(--num);
  opacity: 0.75;
}
.door-zone {
  position: absolute;
  left: 4px; right: 4px; bottom: 7px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--num);
  opacity: 0.9;
  display: none;
}
@media (min-width: 520px) {
  .doors-wide .door-zone { display: block; }
  .doors-wide .door-num { padding-bottom: 26%; }
  .doors-wide .door-state { top: 7px; bottom: auto; }
}

/* Blocată: ușa e închisă și puțin estompată */
.door.is-locked::before, .door.is-locked::after { filter: saturate(0.7) brightness(0.8); }
.door.is-locked .door-num { opacity: 0.8; }
.door.is-locked.is-nudged { animation: door-nudge 360ms var(--ease); }

/* Deschisă: întredeschisă, cu lumină aurie; ușa zilei saltă ușor */
.door.is-available { box-shadow: 0 0 0 3px var(--gold-300), 0 0 22px rgba(255, 220, 128, 0.55); }
.door.is-available::before, .door.is-available::after { transform: scaleX(0.84); }
.door.is-available .door-state { display: none; }
.door.is-available:hover, .door.is-missed:hover { transform: translateY(-3px) scale(1.04); }
.door.is-available:hover::before, .door.is-available:hover::after,
.door.is-missed:hover::before, .door.is-missed:hover::after { transform: scaleX(0.55); }
.door.is-today { animation: door-hop 2.6s var(--ease) infinite; }

/* Rezolvată: larg deschisă, cu stea */
.door.is-completed::before, .door.is-completed::after { transform: scaleX(0.3); }
.door.is-completed .door-num { color: var(--red-600); text-shadow: none; font-size: clamp(0.8rem, 3vw, 1rem); place-items: start; padding: 4px 0 0 7px; inset: 0; z-index: 3; display: none; }
.door.is-completed .door-state { inset: 0; margin: auto; width: 52%; height: 52%; color: var(--red-500); opacity: 1; fill: var(--red-500); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.12)); }
.door.is-completed .door-zone { display: none; }

/* Ratată: acoperită de zăpadă */
.door.is-missed { --leaf: #b9cbe3; --leaf-dark: #8ea6c6; --num: #33506f; background: radial-gradient(circle at 50% 55%, #ffffff, #cfe0f5 75%); }
.door.is-missed::before, .door.is-missed::after { transform: scaleX(0.92); }

/* Boss Challenge */
.door.is-boss { --leaf: var(--gold-500); --leaf-dark: var(--gold-600); --num: #4a2a00; }
.door.is-boss.is-locked::before, .door.is-boss.is-locked::after { filter: none; }

@keyframes door-nudge {
  25% { transform: translateX(-4px) rotate(-2deg); }
  60% { transform: translateX(4px) rotate(2deg); }
}
@keyframes door-hop {
  0%, 82%, 100% { transform: translateY(0); }
  88% { transform: translateY(-7px); }
  94% { transform: translateY(0); }
  97% { transform: translateY(-3px); }
}
@keyframes door-in {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
}
.doors.is-entering .door { animation: door-in 460ms var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 24ms); }
@media (prefers-reduced-motion: reduce) {
  .doors.is-entering .door, .door.is-nudged, .door.is-today { animation: none; }
}

.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-4); font-size: var(--text-sm); color: var(--text-1); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }

/* ---------- Countdown ---------- */
.countdown-label { color: var(--text-0); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: var(--space-2); }
.countdown { display: flex; gap: var(--space-2); }
.countdown-unit {
  min-width: 64px;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--cream);
  box-shadow: 0 4px 0 rgba(3, 10, 22, 0.35);
  text-align: center;
}
.countdown-unit b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--red-600);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.countdown-unit span { font-size: var(--text-xs); font-weight: 700; color: #6b5a44; }

/* ---------- Carduri și stări goale ---------- */
.card {
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--text-2); font-size: 0.95rem; }
.grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.empty {
  padding: var(--space-8) var(--space-6);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  color: var(--text-2);
}
.empty-emoji { display: block; font-size: 2.4rem; line-height: 1; margin-bottom: var(--space-3); }
.empty strong { display: block; color: var(--text-0); font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--space-2); }
.empty p { margin-inline: auto; }
.empty .btn { margin-top: var(--space-4); }

.banner {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--gold-500);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  color: var(--text-0);
}

/* ---------- Taburi ---------- */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2); margin-bottom: var(--space-8); }
.tab {
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  color: var(--text-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}
.tab small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: var(--text-xs); }
.tab[aria-selected="true"] { border-color: var(--gold-500); color: var(--text-0); background: var(--bg-2); box-shadow: 0 4px 0 var(--gold-600); }
.tabs-small .tab { min-height: 44px; font-size: 0.9rem; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; white-space: nowrap; }
.table th { color: var(--text-2); font-size: var(--text-sm); font-weight: 500; background: var(--bg-1); }
.table td { border-top: 1px solid var(--border); color: var(--text-0); }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Formulare ---------- */
.field { display: block; margin-bottom: var(--space-4); }
.field > span { display: block; margin-bottom: var(--space-1); color: var(--text-0); font-weight: 500; font-size: var(--text-sm); }
.field em { color: var(--text-2); font-style: normal; font-weight: 400; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  color: var(--text-0);
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--gold-500); }
.input[aria-invalid="true"] { border-color: var(--red-500); }
.field-error { display: block; min-height: 1.2em; margin-top: var(--space-1); color: #e58c8c; font-size: var(--text-sm); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-4); font-size: var(--text-sm); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold-500); flex: none; }

/* ---------- Notificări ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--space-6); z-index: 90; transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(92vw, 420px); pointer-events: none; }
.toast {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--text-0);
  box-shadow: var(--shadow-card);
  animation: toast-in var(--dur-med) var(--ease);
}
.toast.is-success { border-left-color: var(--green-300); }
.toast.is-error { border-left-color: var(--red-500); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Bara de progres ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--value, 0%); background: linear-gradient(90deg, var(--green-500), var(--gold-500)); border-radius: inherit; transition: width var(--dur-med) var(--ease); }

/* ---------- Footer ---------- */
.site-footer { position: relative; background: var(--green-900); padding-block: var(--space-12) var(--space-8); margin-top: var(--space-16); }
.footer-grid { display: grid; gap: var(--space-8); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.site-footer h3 { font-size: 1rem; margin-bottom: var(--space-3); }
.site-footer li + li { margin-top: var(--space-2); }
.site-footer a { color: var(--text-1); text-decoration: none; }
.site-footer a:hover { color: var(--gold-300); }
.footer-note { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--text-sm); }

/* ---------- Bara de previzualizare (doar fără bază de date) ---------- */
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: #3a2a08;
  border-bottom: 1px solid var(--gold-600);
  color: var(--gold-300);
  font-size: var(--text-sm);
}
.preview-bar select { min-height: 34px; padding: 0 var(--space-2); background: var(--bg-0); border: 1px solid var(--gold-600); border-radius: 6px; color: var(--text-0); }
.preview-bar label { display: inline-flex; align-items: center; gap: var(--space-2); }
.preview-bar input { accent-color: var(--gold-500); width: 18px; height: 18px; }
.footer-note { max-width: none; }

/* ---------- Decor de Crăciun ---------- */
/* Ghirlanda de luminițe de sub header */
.lights {
  display: flex;
  justify-content: space-around;
  height: 16px;
  border-top: 2px solid #0a3a2a;
  overflow: hidden;
  pointer-events: none;
}
.lights i {
  width: 9px; height: 12px;
  margin-top: 1px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--c);
  box-shadow: 0 0 9px 2px var(--c);
  animation: twinkle 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.37s);
}
@keyframes twinkle { 50% { opacity: 0.35; box-shadow: none; } }

/* Ninsoare */
.snow { position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.snow i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: #fff;
  opacity: var(--o);
  animation: snowfall var(--d) linear infinite;
  animation-delay: var(--delay);
}
@keyframes snowfall {
  to { transform: translate(var(--drift), 105vh); }
}

/* Margine de zăpadă: se pune deasupra unui bloc */
.snowcap { position: relative; }
.snowcap::before {
  content: "";
  position: absolute;
  left: 14px; right: 14px; top: -9px;
  height: 22px;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0, #fff 0 10px, transparent 10.5px) 0 9px / 26px 14px repeat-x,
    linear-gradient(#fff, #fff) 0 0 / 100% 10px no-repeat;
  border-radius: 10px 10px 0 0;
  filter: drop-shadow(0 2px 0 rgba(160, 190, 225, 0.5));
}

/* Deal de zăpadă între secțiuni */
.hill { display: block; width: 100%; height: clamp(34px, 6vw, 70px); margin-bottom: -1px; }

@media (prefers-reduced-motion: reduce) {
  .snow { display: none; }
  .lights i { animation: none; }
}
