/* =========================================================
   Golf Getaways - Lead-formulär (overlay <dialog>, flerstegs)
   ---------------------------------------------------------
   Använder samma design-tokens som styles.css. Variablerna
   speglas i :root så att golf-form.html (demo-sidan) också
   fungerar utan att styles.css behöver laddas.
   ========================================================= */
:root {
  --gf-gold:       #a68245;
  --gf-gold-warm:  #d9b677;
  --gf-gold-soft:  #c8a36a;
  --gf-gold-dark:  #7a5a2e;
  --gf-ink:        #131211;
  --gf-ink-2:      #1a1816;
  --gf-paper:      #f7f3eb;
  --gf-white:      #fff;
  --gf-serif:      "Cardo", Georgia, serif;
  --gf-italic:     "Cormorant Garamond", Georgia, serif;
  --gf-body:       "Poppins", -apple-system, "Segoe UI", Roboto, sans-serif;
  --gf-sans:       "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --gf-ease:       cubic-bezier(.22,.61,.36,1);
}
/* Använd projektets tokens när styles.css är laddad. */
@supports (color: var(--gold)) {
  :root {
    --gf-gold:       var(--gold, #a68245);
    --gf-gold-warm:  var(--gold-warm, #d9b677);
    --gf-gold-soft:  var(--gold-soft, #c8a36a);
    --gf-gold-dark:  var(--gold-dark, #7a5a2e);
    --gf-ink:        var(--ink, #131211);
    --gf-paper:      var(--paper, #f7f3eb);
    --gf-serif:      var(--serif, "Cardo", Georgia, serif);
    --gf-italic:     var(--serif-italic, "Cormorant Garamond", Georgia, serif);
    --gf-body:       var(--body, "Poppins", sans-serif);
    --gf-sans:       var(--sans, "Inter", sans-serif);
    --gf-ease:       var(--ease-out, cubic-bezier(.22,.61,.36,1));
  }
}

/* =========================================================
   DEMO-SIDANS .btn-primary
   (på huvudsajten används redan .btn-pill / .btn-outline)
   ========================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 32px;
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--gf-ink);
  background: var(--gf-gold);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .25s var(--gf-ease), transform .25s var(--gf-ease);
}
.btn-primary:hover {
  background: var(--gf-gold-warm);
  transform: translateY(-1px);
}

/* =========================================================
   <dialog> + bakgrund
   ========================================================= */
/* Default = helt dold tills showModal()/show() anropas.
   Browserns native default på <dialog> är display:none - vi tar inte
   över det förrän [open] sätts. */
.gf-dialog {
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid rgba(166, 130, 69, .25);
  background: var(--gf-ink-2);
  color: var(--gf-paper);
  border-radius: 4px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.gf-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: gfOpenDialog .35s var(--gf-ease) both;
}
@keyframes gfOpenDialog {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gf-dialog::backdrop {
  background: rgba(10, 9, 8, .82);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  animation: gfBackdropIn .35s var(--gf-ease) both;
}
@keyframes gfBackdropIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   STÄNGKNAPP
   ========================================================= */
.gf-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: transparent;
  color: var(--gf-paper);
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.gf-close:hover {
  background: var(--gf-gold);
  color: var(--gf-ink);
  border-color: var(--gf-gold);
}
.gf-close:focus-visible {
  outline: 2px solid var(--gf-gold-warm);
  outline-offset: 3px;
}

/* =========================================================
   HEADER (logo, eyebrow, titel, progress)
   ========================================================= */
.gf-head {
  padding: 28px 32px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  flex-shrink: 0;
}

/* Logotyp - bild från assets, centrerad ovanför rubriken */
.gf-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  user-select: none;
}
.gf-brand-logo {
  display: block;
  height: 72px;
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .35));
}
.gf-eyebrow {
  font-family: var(--gf-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--gf-gold);
  text-transform: uppercase;
  margin: 0 0 12px;
}
.gf-title {
  font-family: var(--gf-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  color: var(--gf-paper);
  margin: 0 0 22px;
}
.gf-title em {
  font-style: italic;
  font-family: var(--gf-italic);
  color: var(--gf-gold-warm);
}

.gf-progress { display: flex; flex-direction: column; gap: 8px; }
.gf-progress-bar {
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.gf-progress-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--gf-gold), var(--gf-gold-warm));
  transform-origin: left;
  transform: scaleX(var(--gf-progress, 0));
  transition: transform .55s var(--gf-ease);
}
.gf-progress-text {
  font-family: var(--gf-sans);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, .5);
}
.gf-progress-text em { font-style: normal; color: var(--gf-gold-warm); }

/* =========================================================
   BODY / STEG
   ========================================================= */
.gf-body {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.gf-form { display: contents; }

.gf-step {
  display: none;
  padding: 26px 32px 16px;
  animation: gfStepIn .4s var(--gf-ease) both;
}
.gf-step.is-active { display: block; }
@keyframes gfStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gf-step-title {
  font-family: var(--gf-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  color: var(--gf-paper);
  margin: 0 0 6px;
}
.gf-step-help {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 14px;
  color: rgba(255, 255, 255, .55);
  margin: 0 0 22px;
}
.gf-step--error { animation: gfShake .35s ease-out; }
@keyframes gfShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* =========================================================
   KLICKBARA SVARS-KORT
   ========================================================= */
.gf-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.gf-options legend { display: none; }

.gf-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  min-height: 56px;             /* touch-target ≥ 44 px */
  padding: 14px 56px 14px 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .015);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .25s var(--gf-ease), background-color .25s var(--gf-ease);
}
.gf-option::before,
.gf-option::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  border-radius: 50%;
  transition: all .25s var(--gf-ease);
}
.gf-option::before {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, .25);
  transform: translateY(-50%);
}
.gf-option::after {
  width: 8px;
  height: 8px;
  background: var(--gf-gold);
  transform: translate(-5px, -50%) scale(0);
}
.gf-option:hover {
  border-color: rgba(166, 130, 69, .4);
  background: rgba(166, 130, 69, .04);
}
.gf-option.is-selected {
  border-color: var(--gf-gold);
  background: rgba(166, 130, 69, .08);
}
.gf-option.is-selected::before { border-color: var(--gf-gold); }
.gf-option.is-selected::after  { transform: translate(-5px, -50%) scale(1); }
.gf-option:focus-visible {
  outline: 2px solid var(--gf-gold-warm);
  outline-offset: 2px;
}
.gf-option-title {
  font-family: var(--gf-serif);
  font-size: 18px;
  line-height: 1.2;
  color: var(--gf-paper);
}
.gf-option-desc {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .55);
  margin-top: 4px;
}

/* =========================================================
   KONTAKTSTEG (textfält med flytande etiketter)
   ========================================================= */
.gf-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 16px;
}
.gf-field { position: relative; }
.gf-field--full { grid-column: 1 / -1; }
.gf-field input,
.gf-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 22px 0 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  background: transparent;
  color: var(--gf-paper);
  font-family: var(--gf-body);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color .25s var(--gf-ease);
}
.gf-field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
.gf-field input:focus,
.gf-field textarea:focus { border-color: var(--gf-gold); }
.gf-field label {
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 15px;
  color: rgba(255, 255, 255, .5);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .25s var(--gf-ease), color .25s;
}
.gf-field label em { color: var(--gf-gold); font-style: normal; }
.gf-field input:focus ~ label,
.gf-field input:not(:placeholder-shown) ~ label,
.gf-field textarea:focus ~ label,
.gf-field textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-20px) scale(.72);
  color: var(--gf-gold-warm);
}
.gf-field--invalid input,
.gf-field--invalid textarea { border-bottom-color: #c66; }

/* Honeypot - endast bots */
.gf-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   FOOT (Tillbaka / Nästa / Skicka)
   ========================================================= */
.gf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 32px 26px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  flex-shrink: 0;
}
.gf-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 4px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .55);
  font-family: var(--gf-sans);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s, gap .25s var(--gf-ease);
}
.gf-btn-back:hover { color: var(--gf-gold-warm); gap: 12px; }
.gf-btn-back svg { transition: transform .3s var(--gf-ease); }
.gf-btn-back:hover svg { transform: translateX(-3px); }
.gf-btn-back[hidden] { display: none; }
.gf-btn-back:focus-visible { outline: 2px solid var(--gf-gold-warm); outline-offset: 2px; }

.gf-btn-next,
.gf-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 14px 28px;
  border: 0;
  background: var(--gf-gold);
  color: var(--gf-ink);
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .25s, opacity .25s;
}
.gf-btn-next:hover,
.gf-btn-submit:hover { background: var(--gf-gold-warm); }
.gf-btn-next svg,
.gf-btn-submit svg { transition: transform .3s var(--gf-ease); }
.gf-btn-next:hover svg,
.gf-btn-submit:hover svg { transform: translateX(4px); }
.gf-btn-next[hidden],
.gf-btn-submit[hidden] { display: none; }
.gf-btn-submit:disabled { opacity: .55; pointer-events: none; }
.gf-btn-next:focus-visible,
.gf-btn-submit:focus-visible {
  outline: 2px solid var(--gf-gold-warm);
  outline-offset: 3px;
}

/* =========================================================
   SAMMANFATTNINGSSTEG (efter submit)
   ========================================================= */
.gf-summary {
  display: none;
  padding: 48px 36px 36px;
  text-align: left;
  animation: gfStepIn .45s var(--gf-ease) both;
}
.gf-summary.is-active { display: block; }
.gf-summary-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border: 1.5px solid var(--gf-gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gf-gold);
}
.gf-summary h3 {
  font-family: var(--gf-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  color: var(--gf-paper);
  margin: 0 0 8px;
  text-align: center;
}
.gf-summary h3 em {
  font-family: var(--gf-italic);
  font-style: italic;
  color: var(--gf-gold-warm);
}
.gf-summary-lead {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 15px;
  color: rgba(255, 255, 255, .7);
  margin: 0 auto 28px;
  max-width: 460px;
  line-height: 1.55;
  text-align: center;
}
.gf-summary-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.gf-summary-list .gf-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  font-family: var(--gf-body);
  font-size: 14px;
  font-weight: 300;
}
.gf-summary-list dt {
  color: rgba(255, 255, 255, .5);
  font-weight: 400;
}
.gf-summary-list dd {
  margin: 0;
  text-align: right;
  color: var(--gf-paper);
}
.gf-summary-foot {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 14px;
  color: rgba(255, 255, 255, .55);
  text-align: center;
  margin: 0 0 24px;
}

/* =========================================================
   FELLÄGE
   ========================================================= */
.gf-error {
  display: none;
  padding: 56px 36px;
  text-align: center;
}
.gf-error.is-active { display: block; }
.gf-error-icon {
  width: 56px; height: 56px;
  margin: 0 auto 24px;
  border: 1.5px solid #c66;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c66;
}
.gf-error h3 {
  font-family: var(--gf-serif);
  font-weight: 400;
  font-size: 26px;
  color: var(--gf-paper);
  margin: 0 0 10px;
}
.gf-error p {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 15px;
  color: rgba(255, 255, 255, .65);
  margin: 0 auto 24px;
  max-width: 420px;
  line-height: 1.55;
}

/* =========================================================
   EXIT-CONFIRM (när användaren börjat fylla i)
   ========================================================= */
.gf-confirm {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 14, 12, .92);
  backdrop-filter: blur(4px);
}
.gf-confirm.is-active { display: grid; }
.gf-confirm-box {
  max-width: 380px;
  text-align: center;
  background: var(--gf-ink-2);
  border: 1px solid rgba(166, 130, 69, .25);
  padding: 28px 28px 24px;
}
.gf-confirm-box h4 {
  font-family: var(--gf-serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--gf-paper);
  margin: 0 0 8px;
}
.gf-confirm-box p {
  font-family: var(--gf-body);
  font-weight: 300;
  font-size: 14px;
  color: rgba(255, 255, 255, .6);
  margin: 0 0 22px;
  line-height: 1.5;
}
.gf-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.gf-confirm-actions button {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--gf-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.gf-confirm-cancel {
  background: transparent;
  color: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 255, 255, .18);
}
.gf-confirm-cancel:hover { color: var(--gf-paper); border-color: var(--gf-paper); }
.gf-confirm-leave {
  background: var(--gf-gold);
  color: var(--gf-ink);
  border: 1px solid var(--gf-gold);
}
.gf-confirm-leave:hover { background: var(--gf-gold-warm); border-color: var(--gf-gold-warm); }

/* =========================================================
   RESPONSIVE (mobile-first säkring)
   ========================================================= */
@media (max-width: 560px) {
  .gf-dialog {
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .gf-head { padding: 22px 22px 18px; }
  .gf-step { padding: 22px 22px 12px; }
  .gf-foot { padding: 14px 22px 22px; }
  .gf-title { font-size: 24px; }
  .gf-step-title { font-size: 19px; }
  .gf-fields { grid-template-columns: 1fr; gap: 20px; }
  .gf-summary, .gf-error { padding: 48px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .gf-dialog[open],
  .gf-dialog::backdrop,
  .gf-step,
  .gf-summary,
  .gf-progress-bar::before,
  .gf-option,
  .gf-btn-next svg, .gf-btn-submit svg, .gf-btn-back svg {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
