/* ── Aforia News — Newsletter Signup ── */
/* Design tokens from aforia.ch */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg-primary: #1E1E1E;
  --bg-secondary: #303030;
  --accent-red: #A61A17;
  --accent-red-hover: #8c1513;
  --text-primary: #FFFFFF;
  --text-secondary: #8D8D8D;
  --error-red: #e74c3c;
  --success-green: #417505;
  --input-bg: #1E1E1E;
  --border-radius: 5px;
}

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

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ── Header ── */

.header {
  padding: 20px 40px;
}

.header__logo {
  display: block;
  height: 40px;
  width: auto;
}

/* ── Main ── */

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ── Form Card ── */

.form-card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 40px;
  width: 100%;
  max-width: 600px;
}

.form-card__title {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.form-card__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Form Grid ── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid__full {
  grid-column: 1 / -1;
}

/* Address row wrappers — asymmetric widths matching aforia.ch footer */
.form-grid__row-address {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.form-grid__row-address--zip {
  grid-template-columns: 2fr 3fr;
}

/* ── Input Fields ── */

.field {
  position: relative;
}

.field__input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  padding: 12px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.field__input::placeholder {
  color: var(--text-secondary);
}

.field__input:focus {
  border-color: var(--text-secondary);
}

.field__input--error {
  border-color: var(--error-red);
}

.field__error {
  font-size: 12px;
  color: var(--error-red);
  margin-top: 4px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field__error--visible {
  opacity: 1;
}

/* ── Honeypot (hidden from humans) ── */

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ── Privacy Checkbox ── */

.privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.privacy__checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid var(--text-secondary);
  border-radius: 3px;
  background-color: var(--input-bg);
  cursor: pointer;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.privacy__checkbox:checked {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
}

.privacy__checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.privacy__checkbox--error {
  border-color: var(--error-red);
}

.privacy a {
  color: var(--text-primary);
  text-decoration: underline;
}

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

/* ── Submit Button ── */

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  background-color: var(--accent-red);
  color: var(--text-primary);
  border: 2px solid var(--accent-red);
  border-radius: var(--border-radius);
  padding: 12px 32px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}

.btn-submit:hover:not(:disabled) {
  background-color: transparent;
  border-color: var(--text-primary);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.btn-submit__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-submit--loading .btn-submit__spinner {
  display: block;
}

.btn-submit--loading .btn-submit__text {
  opacity: 0.7;
}

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

/* ── Success State ── */

.success-message {
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.4s ease;
}

.success-message__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--success-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-message__icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
  stroke-width: 3;
  fill: none;
}

.success-message__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-message__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Error Banner (form-level) ── */

.form-error {
  background-color: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--error-red);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--error-red);
  display: none;
}

.form-error--visible {
  display: block;
}

/* ── Turnstile ── */

.turnstile-wrapper {
  position: absolute;
  overflow: hidden;
  width: 0;
  height: 0;
}

/* ── Footer ── */

.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-primary);
}

/* ── Responsive: Mobile ── */

@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }

  .header__logo {
    height: 32px;
  }

  .main {
    padding: 20px 16px;
    align-items: flex-start;
  }

  .form-card {
    padding: 24px 20px;
  }

  .form-card__title {
    font-size: 22px;
  }

  .form-card__subtitle {
    margin-bottom: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid__row-address--zip {
    grid-template-columns: 1fr;
  }

  .field__input {
    min-height: 44px;
  }

  .btn-submit {
    width: 100%;
  }
}

/* ── Embed variant ── */

body.embed {
  background-color: transparent;
  min-height: auto;
  overflow: hidden;
}

body.embed .header,
body.embed .footer {
  display: none;
}

body.embed .main {
  padding: 0;
  align-items: flex-start;
}

body.embed .form-card {
  padding: 24px;
  max-width: 100%;
  border-radius: var(--border-radius);
  min-height: 620px;
  display: flex;
  flex-direction: column;
}

body.embed #form-container {
  flex: 1;
}

body.embed #success-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
