/* «Канцлер и Бергхайн» — donation page theme, inherited unchanged from the
   events site (red/blue halftone newsprint look; backgrounds in
   public/assets/bg/, generated by scripts/halftone.mjs). To be redesigned
   for this project after an approved mockup. */

@import url("./fonts.css");

:root {
  --red: #ff4a2a;
  --red-deep: #e63a1c;
  --blue: #00b4ff;
  --blue-deep: #0098dc;
  --ink: #151515;
  --paper: #fffdf8;
  --paper-2: #f4f1ea;
  --muted: #5f5f5f;
  --line: rgba(21, 21, 21, 0.12);
  --error: #dc2626;

  /* Impact where the OS ships it (macOS, Windows); Sofia Sans Extra Condensed elsewhere */
  --font-display: Impact, "Sofia Sans Extra Condensed", "Arial Narrow Bold", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* background tiles; must match WIDTH / HEIGHT in scripts/halftone.mjs */
  --bg-width: 960px;
  --bg-height: 480px;
}

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

/* Impact has a single weight; never let the browser fake a bolder one */
.strip,
.brand-name,
.card-title,
.card-second-title,
.section-title,
.filled-button,
.filled-button-link,
.agreement-container h1,
.agreement-container h2 {
  font-synthesis: none;
}

html,
body {
  margin: 0;
  background: var(--red);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100vh;
  padding: 0 0 40px;
  position: relative;
  overflow-x: hidden;
}

/* --- Background: red left half, blue right half. The other colour shows
   through as halftone dots: dense at the seam, fading to the outer edge.
   Both tiles are drawn seam → edge; the left one is mirrored. --- */
body::before,
body::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat-y;
  background-size: var(--bg-width) var(--bg-height);
}

body::before {
  left: 0;
  right: 50%;
  background-color: var(--red);
  background-image: url("./bg/left.svg");
  /* anchored left, then the whole layer is mirrored: the tile's dense end
     lands on the seam and any spare width stays at the outer edge */
  background-position: left top;
  transform: scaleX(-1);
}

body::after {
  left: 50%;
  right: 0;
  background-color: var(--blue);
  background-image: url("./bg/right.svg");
  background-position: left top;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Marquee strip with the channel's rubrics --- */
.strip {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 0;
}

.strip .track {
  display: flex;
  width: max-content;
  animation: strip-scroll 60s linear infinite;
}

.strip .track span {
  white-space: nowrap;
  padding-right: 28px;
}

/* the track holds the phrase 8× and moves by half of itself: seamless loop */
.strip .track span::after {
  content: " ·";
}

@keyframes strip-scroll {
  to {
    transform: translateX(-50%);
  }
}

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

/* --- Header: round logo, channel name, language toggle --- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 4px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
  min-width: 0;
}

.mark {
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-name {
  display: block;
  max-width: 190px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  line-height: 0.92;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 5px;
  text-shadow: none;
}

.lang-toggle {
  flex: none;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: 600 13px var(--font-body);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.lang-toggle:hover {
  background: #fff;
}

/* --- Card --- */
.card {
  background: var(--paper);
  border-radius: 22px;
  padding: 26px 22px 24px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
  position: relative;
}


.card-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52px;
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--red);
  text-transform: uppercase;
}

/* the channel name is always lowercase, so it escapes the heading's uppercase */
.card-title .name {
  display: block;
  text-transform: none;
  color: var(--blue);
  font-size: 38px;
  margin-top: 6px;
}

.card-subtitle {
  margin: 14px 0 22px;
  font-size: 14px;
  color: var(--muted);
}

.card-second-title {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  color: var(--red);
}

.card-second-subtitle {
  margin: 0 0 20px;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
}

.section-title {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* --- Segmented control (monthly / one-time) --- */
.seg-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--paper-2);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.tab.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 0 var(--red-deep);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

/* --- Amount chips --- */
.chip-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.chip {
  padding: 16px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  position: relative;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip.active {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 0 var(--blue-deep);
}

.chip-custom {
  grid-column: span 2;
  font-weight: 500;
  color: var(--muted);
}

.chip-custom.active {
  color: #fff;
}

.chip input {
  border: none;
  outline: none;
  width: 80px;
  background: transparent;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  color: inherit;
}

.chip input::-webkit-outer-spin-button,
.chip input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chip input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.euro {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}

.hidden {
  display: none;
}

/* --- Stripe Payment Element --- */
#payment-element {
  margin: 18px 0 0;
}

/* --- Text fields (floating label) --- */
.text-field {
  position: relative;
  margin-top: 16px;
}

.text-field input {
  width: 100%;
  padding: 20px 14px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  box-shadow: none;
  outline: 0;
  transition: border-color 0.15s ease;
}

.text-field input:focus,
.text-field input:focus-visible {
  border-color: var(--red);
  outline: 1px solid var(--red);
  outline-offset: 0;
}

.text-field input:focus:not(:focus-visible) {
  outline: 0;
}

.text-field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.15s ease;
  z-index: 1;
}

.text-field input:focus + label,
.text-field input:not(:placeholder-shown) + label {
  top: 7px;
  transform: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.invalid-input {
  border-color: var(--error) !important;
  outline: 1px solid var(--error);
  outline-offset: 0;
}

.error-message {
  color: var(--error);
  font-size: 12px;
  margin-top: 6px;
  margin-left: 12px;
}

/* --- Buttons --- */
.filled-button,
.filled-button-link {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--red-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.filled-button:hover,
.filled-button-link:hover {
  background: var(--red-deep);
}

.filled-button:active,
.filled-button-link:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--red-deep);
}

.filled-button:disabled {
  background: rgba(21, 21, 21, 0.12);
  color: rgba(21, 21, 21, 0.38);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  margin: 16px 0 0;
}

.inline-link {
  color: inherit;
  text-decoration: underline;
}

/* --- Footer --- */
.footer {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  width: 100%;
  padding: 0 8px;
}

.footer a {
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
  opacity: 0.85;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.footer a:hover {
  text-decoration: underline;
  opacity: 1;
}

/* --- Legal pages --- */
.agreement-container {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 32px auto;
  padding: 28px 24px 32px;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
  font-size: 1rem;
  line-height: 1.6;
}

.agreement-container h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 1rem;
}

.agreement-container h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--blue);
  margin: 2rem 0 0.5rem;
}

.agreement-container p {
  margin-bottom: 1rem;
}

.agreement-container a {
  color: var(--red-deep);
}

@media (max-width: 400px) {
  .card-title {
    font-size: 44px;
  }

  .card-title .name {
    font-size: 32px;
  }

  .brand-name {
    font-size: 19px;
  }
}
