/* ==========================================================
   Pupil-Schulung Contact Form — Frosted Glass Landing Page
   ========================================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand: PUPIL Blue */
  --accent: #2884C1;
  --accent-light: #5eaee0;
  --accent-dark: #1d6a9e;
  --accent-subtle: rgba(40, 132, 193, 0.1);

  /* Neutrals (no pure black) */
  --text-primary: #1a1a2e;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-elevated: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Glass */
  --glass-blur: 40px;
  --glass-border: 1px solid var(--border);
  --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
                        inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --glass-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.35),
                  0 12px 24px -8px rgba(40, 132, 193, 0.08);

  /* Spacing tokens */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;

  /* Timing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 180ms;
  --duration-normal: 300ms;
}

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

body {
  font-family: 'Satoshi', 'Segoe UI', system-ui, sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #0c1222;
}


/* ==========================================================
   Animated Mesh Gradient Background
   ========================================================== */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0c1222 0%, #0a1628 50%, #0d1f33 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.7;
  will-change: transform;
}

.blob-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #2884C1 0%, transparent 65%);
  top: -20%;
  left: -15%;
  animation: drift-1 18s ease-in-out infinite;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #1a6fb5 0%, transparent 65%);
  bottom: -15%;
  right: -15%;
  animation: drift-2 22s ease-in-out infinite;
}

.blob-3 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #3b9fd4 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: drift-3 20s ease-in-out infinite;
}

.blob-4 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 65%);
  top: 20%;
  right: 15%;
  opacity: 0.35;
  animation: drift-4 25s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, 60px) scale(1.1); }
  50% { transform: translate(40px, 120px) scale(0.95); }
  75% { transform: translate(-30px, 80px) scale(1.05); }
}

@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, -40px) scale(1.05); }
  50% { transform: translate(-100px, -80px) scale(1.1); }
  75% { transform: translate(-40px, -60px) scale(0.95); }
}

@keyframes drift-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-40%, -60%) scale(1.15); }
  66% { transform: translate(-60%, -40%) scale(0.9); }
}

@keyframes drift-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 80px) scale(1.2); }
}


/* Grain overlay for texture */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}


/* ==========================================================
   Page Layout
   ========================================================== */
.page-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: var(--space-md) var(--space-md) var(--space-2xl);
}

@media (min-width: 640px) {
  .page-wrapper {
    padding-top: var(--space-xl);
  }
}


/* ==========================================================
   Logos
   ========================================================== */

/* Schule Waltenschwil logo — inside header card */
.logo-school {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.logo-school__img {
  max-width: 380px;
  width: 100%;
  height: auto;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

/* PUPIL logo — below form card */
.logo-pupil {
  text-align: center;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
}

.logo-pupil__img {
  max-width: 170px;
  width: 100%;
  height: auto;
  /* Invert flips the black wordmark to white for the dark background;
     hue-rotate then swaps the inverted (orange) tile back to the brand blue. */
  filter: invert(1) brightness(1.5) hue-rotate(180deg) saturate(1.3);
  opacity: 0.85;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.logo-pupil:hover .logo-pupil__img,
.logo-school:hover .logo-school__img {
  opacity: 1;
}


/* Header card variant — white surface for logo readability */
.glass-card.glass-card--header {
  text-align: center;
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-card--header .page-title {
  color: var(--text-primary);
}

.glass-card--header .page-subtitle {
  color: var(--accent);
}

.page-header {
  text-align: center;
}

.page-title {
  font-family: 'Cabinet Grotesk', 'Satoshi', sans-serif;
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.01em;
  opacity: 0.85;
}


/* ==========================================================
   Frosted Glass Card
   ========================================================== */
.glass-card {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow),
              var(--glass-inner-shadow),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: var(--space-2xl) var(--space-xl);
  animation: card-enter 0.8s var(--ease-out-expo) both;
  animation-delay: 0.15s;
  position: relative;
}

/* Subtle top-edge highlight for physical glass refraction */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2) 30%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0.2) 70%, transparent);
  border-radius: var(--radius-xl);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* ==========================================================
   Form Elements
   ========================================================== */

/* Honeypot — visually hidden */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Group */
.form-group {
  margin-bottom: var(--space-lg);
}

/* 2-col row */
.form-row--2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* On mobile, remove bottom margin from first child to tighten stacked fields */
@media (max-width: 539px) {
  .form-row--2col .form-group:first-child {
    margin-bottom: var(--space-md);
  }
}

@media (min-width: 540px) {
  .form-row--2col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

/* 3-col row */
.form-row--3col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (max-width: 719px) {
  .form-row--3col .form-group:not(:last-child) {
    margin-bottom: var(--space-md);
  }
}

@media (min-width: 720px) {
  .form-row--3col {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

/* Hint text (e.g. Zeitfenster instructions) */
.form-hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-md);
}

/* Labels */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.01em;
}

.required {
  color: var(--accent-light);
  font-weight: 400;
}

/* Input & Select & Textarea base */
.form-input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  line-height: 1.5;
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo),
              background-color var(--duration-fast) var(--ease-out-expo);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.form-input:hover {
  border-color: rgba(94, 174, 224, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.form-input:focus {
  border-color: var(--accent-light);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(94, 174, 224, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.form-input.is-invalid {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.06);
}

.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Textarea */
.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Select wrapper */
.select-wrapper {
  position: relative;
}

.form-select {
  appearance: none;
  cursor: pointer;
  padding-right: 2.75rem;
}

.select-chevron {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.select-wrapper:hover .select-chevron {
  color: var(--accent-light);
}

/* Style select options for readability */
.form-select option {
  background: #1a2332;
  color: #ffffff;
}

/* Error messages */
.form-error {
  display: none;
  font-size: 0.8125rem;
  color: #fca5a5;
  margin-top: var(--space-xs);
  padding-left: 0.125rem;
  font-weight: 500;
}

.form-error.is-visible {
  display: block;
  animation: error-in 0.3s var(--ease-out-expo);
}

@keyframes error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================
   Conditional field (Andere Funktion)
   ========================================================== */
.form-group--conditional {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.4s var(--ease-out-expo),
              opacity 0.3s var(--ease-out-expo),
              margin-bottom 0.3s var(--ease-out-expo);
}

.form-group--conditional.is-visible {
  max-height: 120px;
  opacity: 1;
  margin-bottom: var(--space-lg);
}


/* ==========================================================
   Radio Card Group (IT Fitness)
   ========================================================== */
.radio-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 540px) {
  .radio-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

.radio-card {
  cursor: pointer;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color var(--duration-normal) var(--ease-out-expo),
              background-color var(--duration-normal) var(--ease-out-expo),
              transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
}

.radio-card__inner:hover {
  border-color: rgba(94, 174, 224, 0.25);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.radio-card input:focus-visible + .radio-card__inner {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(94, 174, 224, 0.12);
}

.radio-card input:checked + .radio-card__inner {
  border-color: var(--accent);
  background: rgba(40, 132, 193, 0.12);
  box-shadow: 0 0 0 2px var(--accent),
              0 4px 16px -4px rgba(40, 132, 193, 0.25);
}

.radio-card input:active + .radio-card__inner {
  transform: scale(0.98);
}

.radio-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: rgba(255, 255, 255, 0.55);
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.radio-card input:checked ~ .radio-card__inner .radio-icon,
.radio-card input:checked + .radio-card__inner .radio-icon {
  color: var(--accent-light);
}

.radio-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.35;
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.radio-card input:checked + .radio-card__inner .radio-card__label {
  color: var(--accent-light);
}


/* ==========================================================
   Submit Button
   ========================================================== */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.9375rem 2rem;
  margin-top: var(--space-lg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
  box-shadow: 0 4px 14px -4px rgba(40, 132, 193, 0.5),
              0 0 40px -12px rgba(40, 132, 193, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(40, 132, 193, 0.5),
              0 0 56px -12px rgba(40, 132, 193, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.btn-submit:active {
  transform: translateY(0) scale(0.98);
}

.btn-submit__arrow {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.btn-submit:hover .btn-submit__arrow {
  transform: translateX(3px);
}

/* Loading state */
.btn-submit__loader {
  display: none;
}

.btn-submit.is-loading .btn-submit__text {
  opacity: 0;
}

.btn-submit.is-loading .btn-submit__arrow {
  display: none;
}

.btn-submit.is-loading .btn-submit__loader {
  display: block;
  position: absolute;
}

.spinner {
  width: 1.5rem;
  height: 1.5rem;
  animation: spin 0.75s linear infinite;
}

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

.btn-submit.is-loading {
  pointer-events: none;
  opacity: 0.8;
}


/* ==========================================================
   Success Message
   ========================================================== */
.success-message {
  display: none;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  animation: success-in 0.6s var(--ease-out-expo);
}

.success-message.is-visible {
  display: block;
}

@keyframes success-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--accent);
  margin: 0 auto var(--space-lg);
  stroke-width: 1.5;
}

.success-title {
  font-family: 'Cabinet Grotesk', 'Satoshi', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.success-text {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 40ch;
  margin: 0 auto;
}


/* ==========================================================
   Error Banner
   ========================================================== */
.error-banner {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-lg);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(252, 165, 165, 0.15);
  border-radius: var(--radius-sm);
  animation: error-in 0.4s var(--ease-out-expo);
}

.error-banner.is-visible {
  display: flex;
}

.error-banner__icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #fca5a5;
  flex-shrink: 0;
}

.error-banner__text {
  font-size: 0.875rem;
  color: #fca5a5;
  font-weight: 500;
}


/* ==========================================================
   Footer
   ========================================================== */
.page-footer {
  margin-top: var(--space-2xl);
  text-align: center;
}

.page-footer p {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

.page-footer__credit {
  margin-top: var(--space-xs);
}

.page-footer__credit a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.page-footer__credit a:hover {
  color: var(--accent-light);
}

.page-footer__credit a:focus-visible {
  outline: 1px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ==========================================================
   Responsive Polish
   ========================================================== */
@media (min-width: 640px) {
  .glass-card {
    padding: var(--space-3xl) var(--space-3xl);
  }

  .glass-card--header {
    padding: var(--space-2xl) var(--space-3xl) var(--space-lg);
  }

  .page-wrapper {
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
  }
}

@media (max-width: 539px) {
  .radio-card__inner {
    flex-direction: row;
    text-align: left;
    padding: var(--space-md);
  }

  .radio-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
  }
}

/* Hidden option helper */
select option[hidden] {
  display: none;
}

/* Disabled select options get grayed out */
select option:disabled {
  color: rgba(255, 255, 255, 0.3);
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
