/* Vertybių testas — public styles
   Fixed brand palette per spec: bg #F8F3EA, primary #496E50, error #B42318.
   Direction: warm editorial — Fraunces display serif over DM Sans, paper grain,
   soft botanical washes. Swap --font-display/--font once Figma confirms fonts. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F8F3EA;
  --primary: #496E50;
  --primary-dark: #3a5940;
  --primary-deep: #2e4634;
  --primary-soft: #e6ede7;
  --error: #B42318;
  --error-bg: #fdf1f0;
  --text: #2b2b26;
  --muted: #6f6a5e;
  --border: #e4dccb;
  --surface: #ffffff;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --shadow-soft: 0 1px 2px rgba(43,43,38,.04), 0 8px 28px -12px rgba(73,110,80,.18);
  --ring: 0 0 0 3px rgba(73,110,80,.14);
}

html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Atmosphere: soft green washes + paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(52rem 36rem at 85% -8%, rgba(73,110,80,.09), transparent 60%),
    radial-gradient(40rem 30rem at -10% 105%, rgba(73,110,80,.07), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

::selection { background: var(--primary); color: #fff; }

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  width: 100%;
}

.shell { width: 100%; max-width: 580px; }
.shell.wide { max-width: 720px; }

.brand {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  color: var(--primary);
  letter-spacing: .01em;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.brand::after {
  content: "";
  display: block;
  width: 2.25rem; height: 2px;
  margin: .8rem auto 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: .5;
}

h1.hero {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 550;
  letter-spacing: -.015em;
  line-height: 1.08;
  text-align: center;
  color: var(--primary-deep);
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.orn {
  text-align: center;
  color: var(--primary);
  opacity: .45;
  font-size: .8rem;
  letter-spacing: .5em;
  margin: 0 0 1.25rem;
  user-select: none;
}

.sub {
  font-size: 1.08rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.meta {
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 2.25rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.card-p {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.9rem;
  box-shadow: var(--shadow-soft);
}

/* Buttons */
.btn-p {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 54px; padding: .85rem 2.2rem;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  color: #fff; background: var(--primary);
  border: none; border-radius: 12px; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 0 var(--primary-deep), 0 10px 22px -10px rgba(73,110,80,.45);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.btn-p:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-p:active { transform: translateY(1px); box-shadow: 0 0 0 var(--primary-deep), 0 4px 12px -8px rgba(73,110,80,.4); }
.btn-p:focus-visible { outline: none; box-shadow: var(--ring), 0 2px 0 var(--primary-deep); }
.btn-p:disabled { opacity: .55; cursor: default; transform: none; }
.btn-p.ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); box-shadow: none;
}
.btn-p.ghost:hover { background: var(--primary-soft); transform: translateY(-1px); }
.btn-p.block { width: 100%; }
.btn-p.wide { min-width: min(16rem, 100%); }

@media (hover: none) {
  /* touch devices: no hover-lift, keep the press feedback */
  .btn-p:hover { transform: none; }
}

/* Forms */
.input-p {
  width: 100%; min-height: 54px; padding: .85rem 1.1rem;
  font-size: 1rem; font-family: inherit;
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input-p::placeholder { color: #a49e90; }
.input-p:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input-p.invalid { border-color: var(--error); }

.field-error {
  display: none;
  color: var(--error); font-size: .85rem; font-weight: 500;
  margin-top: .45rem;
}
.field-error.show { display: block; }

.consent-line {
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .85rem; color: var(--muted);
  margin-top: 1.1rem; text-align: left;
}
.consent-line input[type=checkbox] {
  width: 18px; height: 18px; margin-top: .15rem;
  accent-color: var(--primary); flex-shrink: 0;
}
.consent-line a { color: var(--primary); }

.success-note {
  display: none;
  background: var(--primary-soft); color: var(--primary-deep);
  border-radius: 12px; padding: 1rem 1.2rem;
  font-weight: 600; text-align: center; margin-top: 1rem;
}
.success-note.show { display: block; animation: rise .4s ease both; }

.footer-p {
  text-align: center; padding: 1.4rem;
  font-size: .8rem; color: var(--muted);
}
.footer-p a { color: var(--muted); text-underline-offset: 3px; }
.footer-p a:hover { color: var(--primary); }

/* Policy pages (no-JS / direct-link fallback) */
.policy { max-width: 640px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; width: 100%; }
.policy h1 { font-family: var(--font-display); font-weight: 550; color: var(--primary-deep); font-size: 1.8rem; letter-spacing: -.01em; margin-bottom: 1.25rem; }
.policy .body { white-space: pre-wrap; color: var(--text); }
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--primary); text-decoration: none; font-weight: 600;
  font-size: .92rem; margin-bottom: 1.75rem;
}
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Policy popups */
.policy-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(43,43,38,.5);
  align-items: center; justify-content: center;
  padding: 1.25rem;
  backdrop-filter: blur(3px);
}
.policy-overlay.open { display: flex; }
.policy-card {
  background: var(--surface); border-radius: 18px;
  width: 100%; max-width: 620px; max-height: 84vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px -16px rgba(43,43,38,.35);
  animation: rise .3s ease both;
}
.policy-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.policy-head h2 {
  font-family: var(--font-display); font-weight: 550;
  color: var(--primary-deep); font-size: 1.35rem; letter-spacing: -.01em;
}
.policy-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.7rem; line-height: 1; color: var(--muted);
  padding: .2rem .5rem; border-radius: 8px;
}
.policy-close:hover { color: var(--text); background: var(--bg); }
.policy-body {
  padding: 1.25rem 1.6rem 1.6rem;
  overflow-y: auto;
  font-size: .95rem;
  color: var(--text);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .card-p { padding: 1.35rem; }
  .policy-overlay { padding: 0; align-items: flex-end; }
  .policy-card { border-radius: 18px 18px 0 0; max-height: 90vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
