/* Theme support form. Self-contained: no fonts or files from other domains. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f6f6f4;
  --text: #16161a;
  --muted: #55555c;
  --border: #8a8a92;
  --border-soft: #d9d9dd;
  --accent: #1f3fbf;
  --accent-text: #ffffff;
  --focus: #1f3fbf;
  --error: #b3261e;
  --error-bg: #fdecea;
  --ok: #1b6b3a;
  --ok-bg: #e8f5ec;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141417;
    --surface: #1e1e23;
    --text: #f1f1f3;
    --muted: #b4b4bc;
    --border: #7c7c86;
    --border-soft: #33333b;
    --accent: #8ea6ff;
    --accent-text: #0e0e12;
    --focus: #8ea6ff;
    --error: #ff9a8f;
    --error-bg: #3a1a18;
    --ok: #8fdca9;
    --ok-bg: #16301f;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 12px;
  background: var(--bg);
  border: 2px solid var(--focus);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.page__eyebrow {
  margin: 0 0 8px;
  font-size: 0.9375rem;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.2;
}

.page__intro {
  margin: 0 0 12px;
  color: var(--muted);
}

.page__header {
  margin-bottom: 28px;
}

/* --- Form ------------------------------------------------------------- */

.form__note {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.form__row {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 36rem) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  margin-bottom: 22px;
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.field__optional {
  font-weight: 400;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;              /* 16px or more: iOS does not zoom on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px 0;
  font: inherit;
  color: var(--text);
}

.field input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 8px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.field__hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.field__error {
  margin: 6px 0 0;
  color: var(--error);
  font-weight: 600;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}

/* --- Selected files ---------------------------------------------------- */

.files {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.files li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.files__name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.files__size {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.files button {
  min-height: 36px;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

/* --- Honeypot ------------------------------------------------------------ */

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Submit and messages ---------------------------------------------- */

.form__actions {
  margin-top: 8px;
}

.button {
  display: inline-block;
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

@media (min-width: 36rem) {
  .button {
    width: auto;
  }
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notice {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

noscript .notice {
  margin: 0 0 24px;
}

.notice:empty {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.notice p {
  margin: 0 0 6px;
}

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

.notice--ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: var(--ok);
}

.notice--error {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error);
}

.notice:focus {
  outline: none;
}

.notice:focus-visible {
  outline: 3px solid var(--focus);
}

.form__privacy {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
