/* Aspectul invitației: stilul Clasic botanic.
   Culorile vin din tema aleasă în texte.js. Nu e nevoie să modifici acest fișier. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --fundal: #f7f2ea;
  --text: #2d3a5e;
  --secundar: #5a6383;
  --hartie: #fffdf9;
  --linie: rgba(45, 58, 94, .16);
  --scris: 'Great Vibes', 'Segoe Script', cursive;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --nav-h: 56px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundal);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
}

img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.scris { font-family: var(--scris); font-weight: 400; line-height: 1.15; overflow-wrap: break-word; }
section, article { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ---------- Meniul ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--nav-h); padding: 0 16px;
  background: var(--fundal);
  background: color-mix(in srgb, var(--fundal) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linie);
}
/* Un titlu lung rămâne pe un rând; ce nu încape pe telefon se termină cu „…”. */
.nav__titlu {
  flex: 1 1 auto; min-width: 0; padding: 4px 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-family: var(--scris); font-size: clamp(21px, 6vw, 27px); color: var(--text); text-decoration: none; line-height: 1.15;
}
.nav__buton { flex: none; }
.nav__buton {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--linie); border-radius: 999px; background: transparent;
  color: var(--text); font: inherit; font-size: 17px; cursor: pointer;
}
.nav__linkuri {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  flex-direction: column; padding: 4px 16px 14px;
  background: var(--fundal); border-bottom: 1px solid var(--linie);
}
.nav.deschis .nav__linkuri { display: flex; }
.nav__linkuri a {
  display: flex; align-items: center; min-height: 48px;
  color: var(--text); text-decoration: none; font-size: 21px;
  border-bottom: 1px solid var(--linie);
}
.nav__linkuri a:last-child { border-bottom: 0; }

/* ---------- Coperta ---------- */

.coperta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  padding: 64px 22px;
  text-align: center;
}
.coperta__col { position: relative; z-index: 1; max-width: 540px; }
.coperta__deasupra { margin: 0; font-style: italic; font-size: 22px; color: var(--secundar); }
.coperta__nume { margin: .12em 0 .22em; font-size: clamp(58px, 17vw, 96px); text-wrap: balance; }
.coperta__data { margin: 0; font-size: 20px; }
.coperta__grupuri { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 44px; margin-top: 30px; }
.grup { display: flex; flex-direction: column; align-items: center; }
.grup__eticheta { font-style: italic; font-size: 17px; color: var(--secundar); }
.grup__nume { font-size: 29px; }

.decor { position: absolute; width: 150px; height: 150px; color: var(--text); opacity: .5; pointer-events: none; }
.decor svg { display: block; width: 100%; height: 100%; }
.decor--stanga-sus { top: -8px; left: -14px; transform: rotate(90deg); }
.decor--dreapta-jos { bottom: -8px; right: -14px; transform: rotate(-90deg); }
.decor--stanga-jos, .decor--dreapta-sus { display: none; }
img.decor { opacity: 1; object-fit: contain; }
img.decor--stanga-sus { transform: none; }
img.decor--dreapta-jos { transform: rotate(180deg); }
img.decor--stanga-jos { transform: scaleY(-1); }
img.decor--dreapta-sus { transform: scaleX(-1); }

/* ---------- Numărătoarea inversă ---------- */

.numaratoare { display: flex; justify-content: center; gap: clamp(10px, 4vw, 28px); padding: 6px 16px 44px; text-align: center; }
.unitate { display: flex; flex-direction: column; min-width: 60px; }
/* Cifrele au aceeași lățime, ca secundele să nu facă textul să „sară” la fiecare schimbare. */
.unitate__nr { font-variant-numeric: lining-nums tabular-nums; }
.unitate__nr { font-size: 36px; font-weight: 500; line-height: 1.1; font-variant-numeric: lining-nums; }
.unitate__nume { font-size: 16px; color: var(--secundar); }
.numaratoare__azi { margin: 0; font-size: 40px; }

/* ---------- Mesajul ---------- */

.mesaj { padding: 60px 22px; text-align: center; border-top: 1px solid var(--linie); }
.mesaj h2 { margin: 0 0 12px; font-size: 46px; }
.mesaj p { max-width: 32em; margin: 0 auto; }
.poza { border-radius: 50%; object-fit: cover; border: 1px solid var(--linie); background: var(--hartie); }
.poza--mare { width: 210px; height: 210px; margin: 0 auto 26px; }

/* ---------- Locațiile ---------- */

.locatii { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--linie); }
.locatie { padding: 52px 22px; text-align: center; }
.locatie + .locatie { border-top: 1px solid var(--linie); }
.locatie h3 { margin: 0 0 8px; font-size: 42px; }
.locatie p { margin: 2px 0; }
.locatie__cand { font-weight: 600; }
.locatie__adresa { color: var(--secundar); }
.poza--mica { width: 170px; height: 170px; margin: 0 auto 20px; }

.buton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 28px; margin-top: 18px;
  border: 1px solid var(--text); border-radius: 999px;
  background: transparent; color: var(--text);
  font: inherit; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.buton:hover { background: var(--text); color: var(--hartie); }
.buton--plin { background: var(--text); color: var(--hartie); }
.buton--plin:hover { opacity: .9; }
.buton[disabled] { opacity: .6; cursor: progress; }

/* ---------- Formularul de confirmare ---------- */

[hidden] { display: none !important; }

.confirmare { padding: 60px 22px; text-align: center; border-top: 1px solid var(--linie); }
.confirmare h2 { margin: 0 0 8px; font-size: 48px; }
.confirmare__text { margin: 0 auto 26px; max-width: 30em; }
.formular { max-width: 600px; margin: 0 auto; text-align: left; }
.formular fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.camp { margin-bottom: 18px; }
.camp label, .camp legend, .eticheta { display: block; margin-bottom: 6px; font-size: 18px; }
.formular input, .formular select, .formular textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); border-radius: 12px;
  background: var(--hartie); color: var(--text); font: inherit; font-size: 18px;
}
.formular select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.formular textarea { min-height: 96px; resize: vertical; }
.formular input:focus-visible, .formular select:focus-visible, .formular textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.formular [aria-invalid="true"] { border-color: #9a3b32; }
.eroare { margin: 6px 0 0; color: #9a3b32; font-size: 17px; }

.da-nu { display: flex; gap: 10px; }
.alegere, .segment button {
  flex: 1; min-height: 48px; border: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
  background: var(--hartie); color: var(--text); font: inherit; font-size: 18px; cursor: pointer;
}
.alegere { border-radius: 12px; }
.alegere[aria-pressed="true"], .segment button[aria-pressed="true"] { background: var(--text); color: var(--hartie); border-color: var(--text); }

.persoana { padding-top: 16px !important; margin-bottom: 4px !important; border-top: 1px dashed var(--linie) !important; }
.persoana legend { float: left; width: 100%; margin-bottom: 10px; font-style: italic; color: var(--secundar); font-size: 17px; }
.persoana legend + * { clear: both; }
.persoana__rand { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.segment { display: flex; border-radius: 12px; overflow: hidden; }
.segment button { border-radius: 0; }
.segment button + button { border-left: 0; }

.capcana { display: none; }
.formular .buton--plin { display: flex; width: 100%; min-height: 52px; margin-top: 8px; font-size: 19px; }
.stare { min-height: 1.6em; margin: 12px 0 0; color: #9a3b32; text-align: center; }
.multumire { max-width: 30em; margin: 0 auto; padding: 18px 0; font-size: 22px; outline: none; }
.multumire p { margin: 0; }

/* ---------- Finalul ---------- */

.final { padding: 76px 22px 128px; text-align: center; border-top: 1px solid var(--linie); }
.final h2 { margin: 0; font-size: clamp(48px, 15vw, 66px); }

/* ---------- Fereastra „Vezi harta” ---------- */

.dialog {
  width: min(92vw, 380px); padding: 28px 24px 20px;
  border: 1px solid var(--linie); border-radius: 18px;
  background: var(--fundal); color: var(--text); font-family: var(--serif); text-align: center;
}
.dialog::backdrop { background: rgba(29, 35, 52, .45); }
.dialog h2 { margin: 0; font-family: var(--scris); font-weight: 400; font-size: 36px; }
.dialog__loc { margin: 4px 0 16px; color: var(--secundar); }
.dialog__aplicatii { display: flex; flex-direction: column; gap: 10px; }
.dialog__aplicatii .buton { width: 100%; margin: 0; }
.dialog__inchide {
  min-height: 44px; margin-top: 12px; border: 0; background: none;
  color: var(--secundar); font: inherit; text-decoration: underline; cursor: pointer;
}

/* ---------- Apariția copertei (un singur moment, la încărcare) ---------- */

@keyframes apare { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes apare-decor { from { opacity: 0; } }
.mod-pagina .coperta__col > * { animation: apare .9s ease-out both; }
.mod-pagina .coperta__col > :nth-child(2) { animation-delay: .12s; }
.mod-pagina .coperta__col > :nth-child(3) { animation-delay: .24s; }
.mod-pagina .coperta__col > :nth-child(4) { animation-delay: .36s; }
.mod-pagina .decor { animation: apare-decor 1.6s ease-out both; }

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

/* ---------- Varianta pentru PDF (pagini A4) ---------- */

.mod-pdf .coperta { min-height: 1123px; }
.mod-pdf .decor { width: 220px; height: 220px; }
.mod-pdf .decor--stanga-jos { display: block; width: 170px; height: 170px; bottom: -30px; left: -30px; opacity: .3; transform: none; }
.mod-pdf .decor--dreapta-sus { display: block; width: 170px; height: 170px; top: 20px; right: -20px; opacity: .3; transform: rotate(180deg); }
.mod-pdf .locatii { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--linie); }
.mod-pdf .locatie + .locatie { border-top: 0; border-left: 1px solid var(--linie); }
.mod-pdf .coperta__nume { margin-bottom: .4em; }
.mod-pdf .mesaj { padding: 44px 60px; }
.mod-pdf .poza--mare { width: 180px; height: 180px; }
.mod-pdf .locatie { padding: 40px 28px; }
.mod-pdf .final { padding: 36px 22px 48px; }
.mod-pdf .final h2 { font-size: 56px; }

/* ---------- Calculator (ecran lat) ---------- */

@media (min-width: 900px) {
  .nav { padding: 0 48px; }
  .nav__buton { display: none; }
  .nav__linkuri {
    display: flex; position: static; flex-direction: row; gap: 34px;
    padding: 0; background: none; border: 0;
  }
  .nav__linkuri a { min-height: 44px; border: 0; font-size: 19px; }
  .nav__linkuri a:hover { text-decoration: underline; text-underline-offset: 6px; }

  .coperta__nume { font-size: 96px; }
  .decor { width: 320px; height: 320px; }
  .decor--stanga-sus { top: 10px; left: -60px; }
  .decor--dreapta-jos { bottom: -60px; right: -60px; }
  .decor--stanga-jos { display: block; width: 230px; height: 230px; bottom: -40px; left: -40px; opacity: .3; transform: none; }
  .decor--dreapta-sus { display: block; width: 230px; height: 230px; top: 30px; right: -30px; opacity: .3; transform: rotate(180deg); }
  img.decor--stanga-jos, img.decor--dreapta-sus { opacity: .6; }
  img.decor--stanga-jos { transform: scaleY(-1); }
  img.decor--dreapta-sus { transform: scaleX(-1); }

  .mesaj { max-width: 1000px; margin: 0 auto; padding: 84px 40px; }
  .mesaj h2 { font-size: 58px; }
  .mesaj--cu-poza { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; text-align: left; }
  .mesaj--cu-poza p { margin: 0; }
  .mesaj--cu-poza .poza--mare { width: 340px; height: 340px; margin: 0; justify-self: end; }

  .locatii { border-bottom: 1px solid var(--linie); }
  .locatii--2 { grid-template-columns: 1fr 1fr; }
  .locatii--3 { grid-template-columns: repeat(3, 1fr); }
  .locatie { padding: 66px 36px; }
  .locatie + .locatie { border-top: 0; border-left: 1px solid var(--linie); }

  .confirmare { padding: 84px 40px; }
  .confirmare h2 { font-size: 58px; }
  .persoana__rand { grid-template-columns: 1fr 1fr; }

  .final { padding-bottom: 168px; }
  .final h2 { font-size: 82px; }
}
