/* ========================================
   Highlander Diagnostika — Global Styles
   Mobile-first | LIGHT theme | Golden accent
   ======================================== */

/* --- CSS Variables --- */
:root {
  --color-bg: #F8F7F4;
  --color-bg-elevated: #FFFFFF;
  --color-bg-card: #F0EEEB;
  --color-bg-card-hover: #E8E5E0;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6560;
  --color-accent: #ac9351;
  --color-accent-hover: #96803e;
  --color-accent-dim: rgba(172, 147, 81, 0.12);
  --color-border: #E0DDD8;
  --color-error: #d44040;
  --color-success: #4da84d;

  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 200ms ease;
  --transition-normal: 350ms ease;
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* #6 — Subtle grain/noise texture on background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

ul {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 4vw, 2rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.5rem); }

/* --- Shared Layout --- */
.container {
  width: 100%;
  max-width: 720px; /* #1 — zväčšené z 680px */
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow {
  max-width: 560px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(172, 147, 81, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* #1 — CTA shimmer effect */
.btn-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 80%
  );
  transition: none;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { left: -100%; }
  50% { left: 140%; }
}

.btn-cta {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Secondary / outline button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-dim);
}

/* Loading spinner */
.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-primary.loading .spinner {
  display: block;
}

.btn-primary.loading .btn-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   VIDEO PLACEHOLDER
   ======================================== */

.video-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
  overflow: hidden;
}

.video-placeholder__play {
  color: var(--color-accent);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

.video-placeholder:hover .video-placeholder__play {
  opacity: 1;
}

.video-placeholder__label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.video-placeholder--result {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   QUIZ — Layout & Flow
   ======================================== */

.quiz-container {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

/* --- Progress Bar --- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-bg-elevated);
  z-index: 100;
}

.progress-bar__fill {
  height: 100%;
  background: var(--color-accent);
  width: 0%;
  transition: width var(--transition-slow);
  border-radius: 0 2px 2px 0;
}

.progress-info {
  position: fixed;
  top: 12px;
  right: 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  z-index: 100;
  font-variant-numeric: tabular-nums;
}

/* Back button */
.quiz-back {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 100;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 6px 8px;
  transition: color var(--transition-fast);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 4px;
}

.quiz-back:hover {
  color: var(--color-text);
}

.quiz-back svg {
  width: 16px;
  height: 16px;
}

.quiz-back[hidden] {
  display: none;
}

/* --- Question Slides --- */
/* #2 — vertikálne centrované, menší padding hore */
.quiz-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 20px 32px;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

.quiz-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.quiz-slide.exit-left {
  opacity: 0;
  transform: translateX(-60px);
  pointer-events: none;
}

.quiz-slide__inner {
  width: 100%;
  max-width: 520px;
}

/* --- Question Header --- */
.quiz-question__label {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.quiz-question__text {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 28px;
  color: var(--color-text);
}

/* --- Answer Buttons --- */
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-answer {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 56px;
}

.quiz-answer:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-accent);
}

.quiz-answer:active {
  transform: scale(0.98);
}

.quiz-answer.selected {
  background: var(--color-accent-dim);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

/* Answer prefix letter */
.quiz-answer__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.quiz-answer.selected .quiz-answer__key {
  background: var(--color-accent);
  color: #ffffff;
}

/* ========================================
   EMAIL CAPTURE (Q7)
   ======================================== */

.capture-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.form-group input {
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-group input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-dim);
}

.form-group input.error {
  border-color: var(--color-error);
}

.form-group .error-text {
  font-size: 0.8125rem;
  color: var(--color-error);
  display: none;
}

.form-group input.error ~ .error-text {
  display: block;
}

/* Optional field hint */
.form-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* GDPR Checkbox */
.gdpr-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
}

.gdpr-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-card);
  cursor: pointer;
  margin-top: 2px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.gdpr-group input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.gdpr-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.gdpr-group input[type="checkbox"].error {
  border-color: var(--color-error);
}

.gdpr-group label {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  cursor: pointer;
}

.gdpr-group label a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========================================
   LOGO
   ======================================== */

.site-logo {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto 24px;
  background: #1a1a1a;
  border-radius: 50%;
  padding: 8px;
}

.result-page .site-logo {
  margin-bottom: 16px;
}

.footer__logo {
  width: 36px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.7;
  background: #1a1a1a;
  border-radius: 50%;
  padding: 4px;
}

/* ========================================
   HERO — Landing Page
   ======================================== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 60px 0 40px;
  text-align: center;
}

.hero__headline {
  font-weight: 800;
  margin-bottom: 16px;
  max-width: 600px;
}

.hero__subheadline {
  font-size: clamp(1rem, 2.5vw, 1.1875rem);
  color: var(--color-text-muted);
  margin-bottom: 8px;
  max-width: 500px;
  line-height: 1.6;
}

/* Hero content — mobile: stacked */
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.hero__text {
  text-align: center;
}

.hero__photo-wrapper {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero__photo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.hero .btn-cta {
  margin-top: 24px;
}

/* #4 — Social proof counter: skryté keď count=0 */
.social-proof {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.social-proof[hidden] {
  display: none;
}

.social-proof strong {
  color: var(--color-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* #1 — Trust badges hneď pod social proof, NAD cookie banner */
.trust-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.trust-badge svg {
  flex-shrink: 0;
  color: var(--color-accent);
  opacity: 0.7;
}

/* ========================================
   RESULT PAGES
   ======================================== */

.result-page {
  padding: 48px 0 40px;
}

.result-header {
  text-align: center;
  margin-bottom: 8px;
}

.result-header__label {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.result-header__headline {
  font-weight: 800;
  margin-bottom: 8px;
}

.result-header__subline {
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Result author photo */
.result-author {
  display: block;
  width: 120px;
  margin: 24px auto 0;
}

.result-author__photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
}

/* Result body text */
.result-body {
  margin-top: 32px;
}

/* #5 — zväčšený line-height na 1.8 */
.result-body p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--color-text);
  opacity: 0.9;
}

.result-body p:last-child {
  margin-bottom: 0;
}

/* #5 — vizuálny separator medzi textom a krokmi */
.result-steps {
  margin-top: 48px;
  padding-top: 36px;
  position: relative;
}

.result-steps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 1px;
}

.result-steps__title {
  margin-bottom: 24px;
}

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step:last-child {
  margin-bottom: 0;
}

.step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 2px;
}

.step__title {
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.step p {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* CTA block */
.result-cta {
  margin-top: 40px;
  padding: 32px 24px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.result-cta__text {
  font-family: var(--font-heading);
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--color-text);
}

.result-cta__sub {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.result-cta .btn-primary {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

/* Share */
.result-share {
  margin-top: 32px;
  text-align: center;
}

.result-share .btn-secondary {
  max-width: 400px;
  margin: 0 auto;
}

/* ========================================
   PRIVACY PAGE
   ======================================== */

.privacy-page {
  padding: 48px 0 60px;
}

.privacy-page h1 {
  margin-bottom: 8px;
}

.privacy-updated {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
}

.privacy-page section {
  margin-bottom: 32px;
}

.privacy-page section h2 {
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  margin-bottom: 12px;
  color: var(--color-accent);
}

.privacy-page section p {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--color-text);
  opacity: 0.9;
}

.privacy-page section ul {
  list-style: none;
  padding: 0;
}

.privacy-page section li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--color-text);
  opacity: 0.9;
}

.privacy-page section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-accent);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: #1a1a1a;
  color: #f0ece4;
}

.footer .footer__legal,
.footer .footer__brand,
.footer .footer__links a {
  color: rgba(240, 236, 228, 0.6);
}

.footer .footer__links a:hover {
  color: var(--color-accent);
}

.footer__legal {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  line-height: 1.6;
  margin-bottom: 8px;
}

.footer__links {
  font-size: 0.8125rem;
  margin-bottom: 8px;
}

.footer__brand {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.4;
}

/* ========================================
   EXIT INTENT POPUP
   ======================================== */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.popup-overlay[hidden] {
  display: none;
}

.popup {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.popup h3 {
  margin-bottom: 12px;
  font-size: clamp(1.125rem, 4vw, 1.375rem);
}

.popup p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.popup .btn-primary {
  margin-bottom: 12px;
}

.popup__dismiss {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px;
  transition: color var(--transition-fast);
}

.popup__dismiss:hover {
  color: var(--color-text);
}

/* ========================================
   Utilities
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Desktop (640px+)
   ======================================== */

@media (min-width: 640px) {
  /* #2 — desktop: menší top padding, väčší max-width pre odpovede */
  .quiz-slide {
    padding: 40px 40px 40px;
  }

  .quiz-slide__inner {
    max-width: 640px;
  }

  .quiz-answer {
    padding: 18px 24px;
  }

  .progress-info {
    right: 24px;
  }

  .quiz-back {
    left: 24px;
  }

  .hero {
    padding: 80px 0 60px;
  }

  .hero .container {
    max-width: 960px;
  }

  .hero__content {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }

  .hero__text {
    flex: 1;
    text-align: left;
  }

  .hero__photo-wrapper {
    flex: 0 0 340px;
    max-width: 340px;
    border-radius: var(--radius-xl);
  }

  .hero__headline {
    max-width: none;
  }

  .hero__subheadline {
    max-width: none;
  }

  .trust-badges {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }

  .result-cta {
    padding: 40px 32px;
  }

  .popup {
    padding: 40px 36px;
  }
}

/* ========================================
   Reduced motion
   ======================================== */

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