/* notify: "Willst du beim nächsten Turnier dabei sein?" – Turnier-Alert sign-up (double opt-in).
   Reusable: every token falls back to the PadelCompass palette, so the section also works
   on pages without css/base.css. All classes are prefixed .nt-. */

.nt {
  --nt-bg: var(--bg, #0a0a0a);
  --nt-bg-rgb: var(--bg-rgb, 10 10 10);
  --nt-ink: var(--ink, #ffffff);
  --nt-text: var(--text, #d1d5db);
  --nt-muted: var(--muted, #9ca3af);
  --nt-line: var(--line, rgba(255, 255, 255, .1));
  --nt-line2: var(--line2, rgba(255, 255, 255, .18));
  --nt-panel: var(--bg2, #121212);
  --nt-primary: var(--primary, #00ffff);
  --nt-primary-rgb: var(--primary-rgb, 0 255 255);
  --nt-on-primary: var(--on-primary, #000000);
  --nt-secondary: var(--secondary, #ffff00);
  --nt-danger: var(--danger, #f87171);
  --nt-danger-rgb: var(--danger-rgb, 248 113 113);
  --nt-display: var(--font-display, Fraunces, Georgia, serif);
  --nt-font: var(--font, Inter, system-ui, -apple-system, 'Segoe UI', sans-serif);
  --nt-mono: var(--font-mono, 'JetBrains Mono', ui-monospace, Menlo, monospace);
  --nt-ease: var(--ease, cubic-bezier(.2, .8, .2, 1));

  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--nt-ink);
  font-family: var(--nt-font);
  padding-block: clamp(5rem, 13vw, 10rem);
  background: radial-gradient(60% 55% at 85% 30%, rgb(var(--nt-primary-rgb) / .07), transparent 70%);
}
#notify, #notify * { font-feature-settings: "calt" 0; }

/* Faint padel-court outline behind everything. */
.nt-court {
  position: absolute; left: 50%; bottom: -6%; width: min(70rem, 140vw); height: 75%; z-index: -1;
  transform: translateX(-50%); perspective: 700px; pointer-events: none; opacity: .55;
}
.nt-court svg {
  width: 100%; height: 100%;
  transform: rotateX(64deg); transform-origin: 50% 100%;
  fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1.2; vector-effect: non-scaling-stroke;
  -webkit-mask-image: linear-gradient(0deg, #000 10%, transparent 85%);
  mask-image: linear-gradient(0deg, #000 10%, transparent 85%);
}
.nt-court .nt-court-net { stroke: rgb(var(--nt-primary-rgb) / .35); stroke-width: 2; }

.nt-inner {
  display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: center;
  max-width: var(--wide, 76rem); margin-inline: auto;
}
@media (min-width: 980px) {
  .nt-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 33rem); }
}

/* ---- Copy ---- */
.nt-title {
  margin: 1rem 0 1.4rem; max-width: 15ch;
  font: 900 clamp(2.6rem, 9vw, 5rem)/.98 var(--nt-display); letter-spacing: -.03em;
  text-wrap: balance;
}
.nt-title em {
  font-style: italic; font-weight: 700;
  color: var(--nt-primary);
  padding-right: .1em;
}
.nt-sub {
  margin: 0; max-width: 34ch;
  font: 500 clamp(1.15rem, 2.2vw, 1.45rem)/1.5 var(--nt-font); color: var(--nt-text);
}
.nt-perks { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: .6rem; }
.nt-perks li { display: flex; align-items: center; gap: .7rem; color: var(--nt-muted); font-size: 1rem; }
.nt-perks svg {
  flex: none; width: 1.4rem; height: 1.4rem; padding: .22rem; border-radius: 50%;
  background: rgb(var(--nt-primary-rgb) / .1); fill: none; stroke: var(--nt-primary); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Ticket ---- */
.nt-ticket {
  position: relative;
  display: grid; grid-template-rows: auto 1fr;
  border-radius: 1.6rem;
  background: var(--nt-panel);
  box-shadow: 0 40px 90px -35px rgba(0, 0, 0, .85), 0 0 0 1px var(--nt-line2), 0 0 60px -10px rgb(var(--nt-primary-rgb) / .1);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
/* Animated rim: a Cyan light running around the ticket. */
.nt-ticket::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--nt-angle, 0deg), transparent 0 55%, rgb(var(--nt-primary-rgb) / .9) 72%, rgba(255, 255, 255, .7) 80%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: nt-spin 7s linear infinite;
}
@property --nt-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes nt-spin { to { --nt-angle: 360deg; } }

.nt-stub {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .3rem 1rem;
  padding: 1.3rem 1.5rem 1.4rem;
  border-radius: 1.6rem 1.6rem 0 0;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, .035) 0 8px, transparent 8px 16px),
    var(--nt-primary);
  color: var(--nt-on-primary);
}
/* Perforation between stub and body. */
.nt-stub::after {
  content: ''; position: absolute; left: 1.2rem; right: 1.2rem; bottom: -1px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--nt-panel) 0 7px, transparent 7px 13px);
}
.nt-ticket .nt-body::before, .nt-ticket .nt-body::after {
  content: ''; position: absolute; top: -13px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--nt-bg); box-shadow: inset 0 0 0 1px var(--nt-line2);
}
.nt-ticket .nt-body::before { left: -13px; }
.nt-ticket .nt-body::after { right: -13px; }

.nt-stub-kicker { grid-column: 1 / -1; font: 700 .7rem/1 var(--nt-mono); letter-spacing: .22em; text-transform: uppercase; opacity: .75; }
.nt-stub-title { font: 900 clamp(1.5rem, 4.5vw, 1.9rem)/1 var(--nt-display); letter-spacing: -.02em; }
.nt-stub-date {
  display: inline-flex; align-items: center; gap: .45rem; align-self: end; justify-self: end;
  padding: .4rem .7rem; border-radius: 999px; background: rgba(0, 0, 0, .88); color: var(--nt-primary);
  font: 700 .75rem/1 var(--nt-mono); letter-spacing: .06em; white-space: nowrap;
}
.nt-stub-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; animation: nt-pulse 1.6s ease-in-out infinite; }
@keyframes nt-pulse { 50% { opacity: .25; } }

/* A padel ball that drops in and settles on the stub. */
.nt-ball {
  position: absolute; overflow: hidden; right: 7.8rem; top: .9rem; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .7), transparent 35%),
    radial-gradient(circle at 50% 50%, #ffff8c, var(--nt-secondary) 70%);
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.nt-ball::before, .nt-ball::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85); clip-path: inset(0 55% 0 0);
  transform: translateX(-38%) scale(.9);
}
.nt-ball::after { clip-path: inset(0 0 0 55%); transform: translateX(38%) scale(.9); }
.nt-js .nt.is-in .nt-ball { animation: nt-drop 1.4s cubic-bezier(.3, 0, .4, 1) .5s both; }
@keyframes nt-drop {
  0% { transform: translateY(-160%) rotate(-120deg); opacity: 0; }
  35% { transform: translateY(0) rotate(0); opacity: 1; }
  55% { transform: translateY(-45%) rotate(40deg); }
  75% { transform: translateY(0) rotate(60deg); }
  88% { transform: translateY(-12%) rotate(70deg); }
  100% { transform: translateY(0) rotate(75deg); }
}

.nt-body { position: relative; padding: clamp(1.5rem, 4vw, 2.1rem); }

/* ---- Form ---- */
.nt-form { display: grid; gap: .3rem; margin: 0; }
.nt-form[hidden] { display: none; }
.nt-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.nt-label { font: 700 .95rem/1.3 var(--nt-font); margin-bottom: .45rem; }

.nt-row { display: grid; gap: .6rem; }
@media (min-width: 520px) {
  .nt-row {
    grid-template-columns: minmax(0, 1fr) auto; gap: 0;
    padding: .35rem; border-radius: 999px;
    background: rgb(var(--nt-bg-rgb) / .65); box-shadow: inset 0 0 0 1px var(--nt-line2);
    transition: box-shadow .2s;
  }
  .nt-row:focus-within { box-shadow: inset 0 0 0 1px var(--nt-primary), 0 0 0 4px rgb(var(--nt-primary-rgb) / .15); }
  .nt-row .nt-input { background: transparent; box-shadow: none; padding-left: 1.1rem; }
  .nt-row .nt-input:focus-visible { outline: none; box-shadow: none; }
}
.nt-input {
  width: 100%; min-width: 0; min-height: 3.25rem; padding: .8rem 1.1rem;
  border: 0; border-radius: 999px; background: rgb(var(--nt-bg-rgb) / .65);
  box-shadow: inset 0 0 0 1px var(--nt-line2);
  color: var(--nt-ink); font: 500 1.0625rem/1.2 var(--nt-font); /* ≥16px: no iOS zoom */
  transition: box-shadow .2s;
}
.nt-input::placeholder { color: var(--nt-muted); opacity: .8; }
.nt-input:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--nt-primary), 0 0 0 4px rgb(var(--nt-primary-rgb) / .15); }
.nt-input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--nt-danger); }
.nt-row:has(.nt-input[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--nt-danger); }

.nt-btn {
  position: relative; overflow: hidden; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.25rem; padding: .8rem 1.5rem; border: 0; border-radius: 999px;
  background: var(--nt-primary); color: var(--nt-on-primary);
  font: 800 1.02rem/1 var(--nt-font); letter-spacing: -.005em; white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgb(var(--nt-primary-rgb) / .45);
  transition: transform .2s var(--nt-ease), box-shadow .2s, filter .2s;
}
.nt-btn::after { /* shine sweep */
  content: ''; position: absolute; inset: -20% auto -20% -40%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg) translateX(-150%);
}
.nt-btn:hover { filter: brightness(1.05); box-shadow: 0 14px 34px -10px rgb(var(--nt-primary-rgb) / .6); }
.nt-btn:hover::after { animation: nt-shine .9s var(--nt-ease); }
@keyframes nt-shine { to { transform: skewX(-20deg) translateX(600%); } }
.nt-btn:active { transform: scale(.97); }
.nt-btn:focus-visible { outline: 2px solid var(--nt-ink); outline-offset: 3px; }
.nt-btn[disabled] { cursor: progress; filter: saturate(.7); }
.nt-btn-busy {
  display: none; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2.5px solid rgba(0, 0, 0, .25); border-top-color: var(--nt-on-primary);
  animation: nt-rot .7s linear infinite;
}
.nt-ticket[data-state="loading"] .nt-btn-busy { display: inline-block; }
@keyframes nt-rot { to { transform: rotate(360deg); } }

.nt-error { margin: .35rem 0 0; min-height: 0; color: var(--nt-danger); font-size: .9rem; font-weight: 600; }
.nt-error:empty { display: none; }

.nt-region { margin: 1.1rem 0 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.nt-region legend { padding: 0; margin-bottom: .55rem; font-weight: 700; font-size: .95rem; }
.nt-opt { font-weight: 500; color: var(--nt-muted); }
.nt-chip { position: relative; cursor: pointer; }
.nt-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nt-chip span {
  display: inline-flex; align-items: center; min-height: 2.6rem; padding: .55rem 1rem; border-radius: 999px;
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--nt-line2);
  font: 600 .92rem/1.2 var(--nt-font); color: var(--nt-text); transition: background-color .2s, box-shadow .2s, color .2s;
}
.nt-chip:hover span { box-shadow: inset 0 0 0 1px rgb(var(--nt-primary-rgb) / .55); }
.nt-chip input:checked + span { background: rgb(var(--nt-primary-rgb) / .12); box-shadow: inset 0 0 0 1.5px var(--nt-primary); color: var(--nt-ink); }
.nt-chip input:focus-visible + span { outline: 2px solid var(--nt-primary); outline-offset: 3px; }

.nt-consent { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start; margin-top: 1.2rem; }
.nt-consent input {
  appearance: none; -webkit-appearance: none; margin: .15rem 0 0; cursor: pointer;
  width: 1.4rem; height: 1.4rem; border-radius: .4rem; display: grid; place-items: center;
  background: rgb(var(--nt-bg-rgb) / .65); box-shadow: inset 0 0 0 1.5px var(--nt-line2);
  transition: background-color .15s, box-shadow .15s;
}
.nt-consent input::after {
  content: ''; width: .75rem; height: .4rem; margin-top: -.15rem;
  border: solid var(--nt-on-primary); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0);
  transition: transform .15s var(--nt-ease);
}
.nt-consent input:checked { background: var(--nt-primary); box-shadow: none; }
.nt-consent input:checked::after { transform: rotate(-45deg) scale(1); }
.nt-consent input:focus-visible { outline: 2px solid var(--nt-primary); outline-offset: 3px; }
.nt-consent input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--nt-danger); }
.nt-consent label { font-size: .88rem; line-height: 1.55; color: var(--nt-muted); cursor: pointer; }
.nt-consent a { color: var(--nt-primary); }

.nt-status { margin: .9rem 0 0; font-size: .95rem; font-weight: 600; }
.nt-status:empty { display: none; }
.nt-status.is-error {
  padding: .75rem 1rem; border-radius: .9rem;
  background: rgb(var(--nt-danger-rgb) / .1); box-shadow: inset 0 0 0 1px rgb(var(--nt-danger-rgb) / .45); color: #fecaca;
}

/* ---- Success ---- */
.nt-done { position: relative; text-align: center; padding: .5rem 0 .2rem; outline: none; }
.nt-done[hidden] { display: none; }
.nt-check { width: 4.2rem; height: 4.2rem; margin: 0 auto 1.1rem; }
.nt-check svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nt-check circle { stroke: var(--nt-primary); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: nt-draw .7s var(--nt-ease) forwards; }
.nt-check path { stroke: var(--nt-primary); stroke-width: 4; stroke-dasharray: 36; stroke-dashoffset: 36; animation: nt-draw .45s var(--nt-ease) .55s forwards; }
@keyframes nt-draw { to { stroke-dashoffset: 0; } }
.nt-done-title { margin: 0 auto .7rem; max-width: 22ch; font: 900 clamp(1.45rem, 4vw, 1.8rem)/1.15 var(--nt-display); letter-spacing: -.01em; }
.nt-done-text { margin: 0 auto 1.3rem; max-width: 38ch; color: var(--nt-text); font-size: .98rem; }
.nt-again {
  cursor: pointer; border: 0; background: none; padding: .4rem .2rem;
  color: var(--nt-primary); font: 600 .92rem/1.2 var(--nt-font); text-decoration: underline; text-underline-offset: .2em;
}
.nt-stamp {
  position: absolute; top: -.6rem; right: -.2rem;
  padding: .35rem .7rem; border: 2.5px solid var(--nt-secondary); border-radius: .5rem;
  color: var(--nt-secondary); font: 800 .78rem/1 var(--nt-mono); letter-spacing: .2em; text-transform: uppercase;
  transform: rotate(9deg); opacity: .9;
  animation: nt-stamp .5s cubic-bezier(.2, 1.6, .4, 1) .9s both;
}
@keyframes nt-stamp { from { transform: rotate(9deg) scale(2.4); opacity: 0; } to { transform: rotate(9deg) scale(1); opacity: .9; } }
.nt-ticket[data-state="success"] { box-shadow: 0 40px 90px -35px rgba(0, 0, 0, .85), 0 0 0 1px rgb(var(--nt-primary-rgb) / .5), 0 0 80px -10px rgb(var(--nt-primary-rgb) / .25); }

/* Celebration balls (spawned by js/notify.js, removed after the animation). */
.nt-burst { position: absolute; left: 50%; top: 2.5rem; width: 0; height: 0; pointer-events: none; z-index: 3; }
.nt-burst i {
  position: absolute; left: -.35rem; top: -.35rem; width: .7rem; height: .7rem; border-radius: 50%;
  background: var(--c, var(--nt-primary));
  animation: nt-fly 1.1s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes nt-fly {
  0% { transform: translate(0, 0) scale(.4); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; }
}

/* ---- Entrance (only when JS runs; without JS everything is simply visible) ---- */
.nt-js .nt .nt-in { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--nt-ease), transform .9s var(--nt-ease); }
.nt-js .nt.is-in .nt-in { opacity: 1; transform: none; }
.nt-js .nt.is-in .nt-in:nth-child(2) { transition-delay: .08s; }
.nt-js .nt.is-in .nt-in:nth-child(3) { transition-delay: .16s; }
.nt-js .nt.is-in .nt-in:nth-child(4) { transition-delay: .24s; }
.nt-js .nt.is-in .nt-ticket { transition-delay: .2s; }

@media (max-width: 519px) {
  .nt-btn { width: 100%; }
  .nt-ball { right: auto; left: 62%; }
  .nt-stub { grid-template-columns: 1fr; }
  .nt-stub-date { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .nt-ticket::before, .nt-stub-dot, .nt-btn:hover::after { animation: none; }
  .nt-js .nt .nt-in { opacity: 1; transform: none; transition: none; }
  .nt-js .nt.is-in .nt-ball { animation: none; }
  .nt-check circle, .nt-check path { animation: none; stroke-dashoffset: 0; }
  .nt-stamp { animation: none; }
  .nt-burst { display: none; }
}
