/* SOUNDGLOW: the withdrawal page (DK /fortrydelse/, EN /withdrawal/,
   DE /de/widerruf/, FR /fr/retractation/). Loads after chrome.css and
   legal.css and uses their tokens. Must stay byte-identical DK <-> EN.

   Task first: the form leads, the rules sit beside it as a short list of
   deadlines, and the return address is a label you can copy. */

.wd-main { max-width: 1080px; }
.wd-main ::selection { background: rgba(168,85,247,0.4); color: var(--white); }

.wd-header { margin-bottom: 3rem; }
.wd-lead {
  max-width: 34em;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--white);
  text-wrap: pretty;
}

.wd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 4.5rem;
  align-items: start;
}

/* Section headings: the form and the confirmation. */
.wd-form-section > h2,
.wd-done h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-h);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--white);
}
.wd-form-section > h2,
.wd-done h2 { font-size: clamp(2rem, 4vw, 2.5rem); }

/* ── The form ────────────────────────────────────────────────────── */
.wd-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 1.25rem;
}
.wd-form[hidden] { display: none; }
.wd-field, .wd-fieldset, .wd-actions, .wd-form .msg { grid-column: 1 / -1; }
.wd-field--half { grid-column: auto; }
.wd-form .items-row { display: none; }

.wd-label {
  display: block;
  margin-bottom: 0.45rem;
  padding: 0;
  font-family: var(--font-b);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
}
.wd-optional { font-weight: 400; color: var(--muted); }
.wd-hint {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

.wd-input {
  display: block;
  width: 100%;
  padding: 0.8rem 0.95rem;
  font-family: var(--font-b);
  font-size: 1rem; /* 16px: no zoom-on-focus on iOS */
  line-height: 1.4;
  color: var(--white);
  background: var(--bg2);
  border: 1px solid rgba(240,238,255,0.16);
  border-radius: 6px;
  caret-color: var(--purple);
  transition: border-color 0.15s;
}
.wd-input::placeholder { color: var(--muted); opacity: 1; }
.wd-input:hover { border-color: rgba(240,238,255,0.3); }
.wd-input:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; border-color: var(--purple); }
.wd-input[aria-invalid="true"] { border-color: var(--pink); }
textarea.wd-input { min-height: 5.5rem; resize: vertical; line-height: 1.5; }

.wd-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.wd-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.wd-choice { position: relative; display: block; cursor: pointer; }
.wd-choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.wd-choice span {
  display: block;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  color: var(--light);
  background: var(--bg2);
  border: 1px solid rgba(240,238,255,0.16);
  border-radius: 6px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.wd-choice:hover span { border-color: rgba(240,238,255,0.3); }
.wd-choice input:checked + span {
  color: var(--btn-fg);
  background: var(--btn-bg);
  border-color: transparent;
  box-shadow: var(--btn-ring);
}
.wd-choice input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 2px; }

.wd-actions { margin-top: 0.25rem; }
.wd-actions .btn-primary[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.wd-form .hp { position: absolute; left: -9999px; top: -9999px; }

.wd-form .msg {
  display: none;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--white);
  border-radius: 6px;
}
.wd-form .msg.ok { display: block; background: rgba(168,85,247,0.12); border: 1px solid var(--border-purple); }
.wd-form .msg.err { display: block; background: rgba(236,72,153,0.1); border: 1px solid rgba(236,72,153,0.55); }

/* The confirmation that replaces the form once it has been sent:
   the real last return date and the address, right where the form was. */
.wd-done {
  padding: 2rem 2rem 1.5rem;
  background: rgba(168,85,247,0.08);
  border: 1px solid var(--border-purple);
  border-radius: 8px;
  animation: wd-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.wd-done:focus { outline: none; }
.wd-done h2 { margin-bottom: 0.9rem; }
.wd-done p { margin: 0 0 0.9rem; font-size: 1rem; line-height: 1.6; color: var(--light); }
.wd-done .wd-due { margin-top: 1.4rem; color: var(--white); }
.wd-due time { font-weight: 700; }
.wd-done .wd-address { margin-bottom: 0.5rem; font-size: 1.05rem; }
@keyframes wd-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wd-done { animation: none; }
}

.wd-small {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.wd-small a { text-decoration: underline; text-underline-offset: 3px; }

/* ── The rules: three short steps, then the address ────────────────── */
/* Sticky only where the whole column fits on screen. */
@media (min-width: 901px) and (min-height: 860px) {
  .wd-rules { position: sticky; top: 2rem; }
}

.wd-terms { margin: 0; }
.wd-term { padding: 1.1rem 0 1.15rem; border-bottom: 1px solid var(--border); }
.wd-term dt {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
}
.wd-term dd {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--light);
}

.wd-address {
  margin: 0;
  font-style: normal;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--white);
}

.wd-return {
  margin-top: 1.5rem;
  padding: 1.1rem 1.2rem 1rem;
  background: var(--bg2);
  border: 1px solid rgba(240,238,255,0.16);
  border-radius: 6px;
}
.wd-return-label {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.wd-copy {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.2rem 0;
  font-family: var(--font-b);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s;
}
.wd-copy[hidden] { display: none; }
.wd-copy:hover { color: var(--pink); }
.wd-copy:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 2px; }

/* ── Tablets and phones: one column, form first ──────────────────── */
@media (max-width: 900px) {
  .wd-layout { grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
  .wd-rules { position: static; padding-top: 1rem; border-top: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .wd-header { margin-bottom: 2.25rem; }
  .wd-lead { font-size: 1.05rem; }
  .wd-form { grid-template-columns: 1fr; gap: 1.4rem; }
  .wd-field--half { grid-column: 1 / -1; }
  .wd-actions .btn-primary { width: 100%; }
  .wd-done { padding: 1.5rem 1.25rem 1.1rem; }
}
@media (max-width: 400px) {
  .wd-choices { grid-template-columns: 1fr; }
}
