/*
 * dutchdutch.com-style design system for the generated form.
 *
 * Tokens are mirrored from the site's custom stylesheet (dd-base.css):
 *  - warm off-white "porcelain" canvas, near-black "onyx" text,
 *  - brand orange accents (#EF6623) for eyebrows, focus rings and selections,
 *  - DM Sans (display) + Rethink Sans (body),
 *  - pill buttons and inputs, soft panel cards (#F1EEE8).
 *
 * The page is chrome-free (no header/footer) so it can be embedded into the
 * website; the email keeps a wordmark header and footer.
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&family=Rethink+Sans:wght@400;500;600&display=swap");

:root {
  --palette-porcelain: #faf8f4;
  --palette-dust-grey: #e7e5e0;
  --palette-silver: #ada9a4;
  --palette-dim-grey: #73706d;
  --palette-charcoal-brown: #413f3c;
  --palette-graphite: #2c2a27;
  --palette-onyx: #161412;

  --color-brand: #ef6623;
  --color-brand-rgb: 239, 102, 35;
  --color-brand-deep: #c24e15;

  --color-utility-positive: #4b9163;
  --color-utility-error: #b0413a;

  --font-display: "DM Sans", system-ui, sans-serif;
  --font-body: "Rethink Sans", system-ui, sans-serif;

  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --bg: var(--palette-porcelain);
  --text: var(--palette-onyx);
  --text-2: var(--palette-graphite);
  --muted: var(--palette-dim-grey);
  --line: var(--palette-dust-grey);
  --panel: #f1eee8;

  --easing-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.3;
}

/* --- page head: eyebrow / title / lead (mirrors site blocks) -------------- */

.page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 1.25rem 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--color-brand);
  flex: none;
}

.title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 3rem;
}

/* --- form entries: one soft panel card per element ------------------------ */

.entries {
  display: grid;
  gap: 1rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.entry {
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  animation: fade-up 0.9s var(--easing-out) both;
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.entry-text {
  color: var(--text-2);
}

.entry > label,
.entry-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

/* --- controls ------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font: inherit;
  color: var(--text);
}

/* The date input keeps the native calendar icon visible: a fully pill-shaped
   border would clip it, so it uses the softer radius with a calmer icon. */
input[type="date"] {
  border-radius: var(--radius-md);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2373706d' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
}

textarea {
  width: 100%;
  min-height: 6.5rem;
  padding: 0.85rem 1.2rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--text);
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--palette-dim-grey);
}

input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font: inherit;
  color: var(--text);
}

input[type="file"]::file-selector-button {
  border: 0;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  margin-right: 0.8rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.file-list {
  list-style: none;
  margin: 0.6rem 0 0;
  display: grid;
  gap: 0.3rem;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 0.9rem;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.file-remove:hover,
.file-remove:focus-visible {
  background: rgba(176, 65, 58, 0.12);
  color: var(--color-utility-error);
}

.muted {
  color: var(--muted);
}

input[type="checkbox"] {
  accent-color: var(--color-brand);
  width: 18px;
  height: 18px;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body) !important;
  font-weight: 400 !important;
  font-size: 1rem !important;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-card:hover {
  border-color: var(--text);
}

.option-card:has(input:checked) {
  border-color: var(--color-brand);
  background: rgba(var(--color-brand-rgb), 0.08);
}

.option-card input {
  accent-color: var(--color-brand);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- buttons (site .btn: pill, lifts on hover) ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--easing-out), background 0.25s, color 0.25s,
    border-color 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
}

#submit-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* A submission in flight: disabled + spinner, so repeat clicks can't fire. */
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled:hover {
  transform: none;
}

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

.btn.is-busy::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- status / help -------------------------------------------------------- */

.status {
  margin-top: 1rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  white-space: pre-line;
}

.status.ok {
  background: rgba(75, 145, 99, 0.12);
  color: #2f5a41;
}

.status.err {
  background: rgba(176, 65, 58, 0.1);
  color: #8a322b;
}

/* --- confirmation view ---------------------------------------------------- */

.confirmation {
  padding: 3.5rem 2rem;
  background: var(--panel);
  border-radius: var(--radius-md);
  text-align: center;
  animation: fade-up 0.9s var(--easing-out) both;
}

.confirmation-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.confirmation-text {
  color: var(--text-2);
}

.ticket-id {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-brand);
  margin-top: 0.5rem;
}

.confirmation-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- dead-end final page -------------------------------------------------- */

.entry.dead-end {
  text-align: center;
  padding: 2.5rem 2rem;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* [hidden] must win over display rules such as .btn or .entry animations. */
[hidden] {
  display: none !important;
}

.help {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.req {
  color: var(--color-brand);
}

/* --- inline validation errors --------------------------------------------- */

.field-error {
  margin-top: 0.5rem;
  color: var(--color-utility-error);
  font-size: 0.85rem;
}

.entry.invalid {
  box-shadow: inset 0 0 0 1px rgba(176, 65, 58, 0.55);
}

/* --- responsive + reduced motion ------------------------------------------ */

@media (max-width: 640px) {
  .page {
    padding-top: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry {
    animation: none;
  }

  .btn,
  .option-card {
    transition: none;
  }

  .btn.is-busy::before {
    animation: none;
  }
}
