.auth-portal {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 72px);
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px) 24px;
  background:
    radial-gradient(circle at 52% 8%, rgba(255, 205, 91, .28), transparent 25rem),
    radial-gradient(circle at 82% 18%, rgba(244, 129, 60, .18), transparent 21rem),
    radial-gradient(circle at 10% 14%, rgba(76, 188, 235, .25), transparent 29rem),
    radial-gradient(circle at 88% 82%, rgba(120, 92, 226, .16), transparent 30rem),
    linear-gradient(180deg, #fff 0%, #fbfbff 52%, #f5f8fc 100%);
}

.auth-portal::before {
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(ellipse at 55% 24%, rgba(255, 216, 119, .4), transparent 32%),
    radial-gradient(circle at 18% 72%, rgba(76, 189, 235, .22), transparent 25%),
    radial-gradient(circle at 82% 62%, rgba(244, 129, 60, .2), transparent 24%);
  filter: blur(38px);
  content: "";
  transform: rotate(-8deg);
}

.auth-portal::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 7% 92%, rgba(78, 188, 232, .14), transparent 21rem),
    radial-gradient(circle at 95% 5%, rgba(255, 185, 66, .13), transparent 19rem);
  opacity: .9;
  content: "";
}

.auth-portal__aurora {
  position: absolute;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 44% 56% 62% 38%;
  filter: blur(1px);
  opacity: 0.52;
}

.auth-portal__aurora--one {
  top: -25vw;
  right: -8vw;
  background: radial-gradient(circle at 35% 65%, rgba(255, 197, 78, .28), transparent 52%);
  transform: rotate(24deg);
}

.auth-portal__aurora--two {
  bottom: -34vw;
  left: -12vw;
  background: radial-gradient(circle at 70% 30%, rgba(72, 185, 232, .23), transparent 54%);
  transform: rotate(-20deg);
}

.auth-portal__grid {
  display: grid;
  width: min(570px, 100%);
  min-height: min(690px, calc(100svh - 150px));
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 38px;
  background: rgba(250, 250, 255, 0.38);
  box-shadow:
    0 42px 110px rgba(65, 51, 105, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(30px) saturate(140%);
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 46px;
  background:
    radial-gradient(circle at 72% 18%, rgba(103, 221, 246, 0.22), transparent 30%),
    linear-gradient(152deg, rgba(45, 45, 105, 0.96), rgba(82, 54, 138, 0.91) 52%, rgba(160, 73, 146, 0.83));
  color: #fff;
}

.auth-story::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 48%, rgba(255, 255, 255, 0.1) 49%, transparent 51%),
    radial-gradient(circle at 25% 92%, rgba(108, 217, 240, 0.25), transparent 32%);
  content: "";
}

.auth-story > img {
  position: relative;
  width: min(310px, 84%);
  height: auto;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(21, 21, 60, 0.18);
  backdrop-filter: blur(16px);
}

.auth-story__copy {
  position: relative;
  z-index: 1;
  margin-top: clamp(64px, 9vh, 106px);
}

.auth-story__copy span {
  color: #8feeff;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-story__copy h2 {
  max-width: 12ch;
  margin: 15px 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-story__copy p {
  max-width: 35ch;
  margin: 0;
  color: rgba(245, 244, 255, 0.74);
  font-size: 0.78rem;
  line-height: 1.65;
}

.auth-bond {
  position: relative;
  display: grid;
  width: 285px;
  margin: auto auto 30px;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  transform: perspective(620px) rotateX(58deg) rotateZ(-18deg);
}

.auth-bond::after {
  position: absolute;
  inset: -25%;
  z-index: -1;
  background: radial-gradient(circle, rgba(102, 226, 255, 0.28), transparent 65%);
  filter: blur(22px);
  content: "";
}

.auth-bond span {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(123, 215, 240, 0.07));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.32), 0 12px 24px rgba(25, 24, 74, 0.2);
}

.auth-bond span:nth-child(5),
.auth-bond span:nth-child(9) {
  margin-left: 36px;
}

.auth-bond span:nth-child(8),
.auth-bond span:nth-child(11) {
  margin-right: -36px;
}

.auth-story__status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.63rem;
  font-weight: 720;
}

.auth-story__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78f3de;
  box-shadow: 0 0 14px #78f3de;
}

.auth-card-wrap {
  display: grid;
  place-items: center;
  padding: clamp(30px, 5vw, 68px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(249, 247, 255, 0.62));
}

.auth-card {
  width: min(100%, 410px);
}

.payment-error {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 22px;
  padding: 17px;
  border: 1px solid rgba(190, 84, 61, 0.22);
  border-radius: 18px;
  background: rgba(255, 245, 240, 0.8);
  color: #50251f;
}

.payment-error__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: #fff;
  color: #b44e3c;
  box-shadow: 0 8px 22px rgba(104, 47, 40, 0.12);
}

.payment-error strong,
.payment-error p {
  display: block;
  margin: 0;
}

.payment-error p {
  margin-top: 4px;
  color: #795048;
  font-size: 0.78rem;
  line-height: 1.5;
}

.payment-error code {
  display: inline-block;
  margin-top: 9px;
  color: #976358;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.payment-error__actions {
  display: grid;
  gap: 11px;
}

.payment-error__actions form {
  margin: 0;
}

.payment-support-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(72, 66, 111, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.64);
  color: #3f3766;
  font-size: 0.83rem;
  font-weight: 780;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.payment-support-button:hover {
  border-color: rgba(72, 66, 111, 0.36);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.payment-support-button .material-symbols-outlined {
  font-size: 1.15rem;
}

.payment-error__back {
  margin: 20px 0 0;
  text-align: center;
}

.payment-error__back a {
  color: #665d7e;
  font-size: 0.76rem;
  font-weight: 720;
}

.auth-card__logo {
  display: block;
  width: min(480px, 100%);
  height: auto;
  margin: 0 auto 42px;
  filter: drop-shadow(0 14px 24px rgba(40, 31, 54, .2));
}

.auth-card header {
  margin-bottom: 26px;
}

.auth-card__eyebrow {
  margin: 0 0 9px;
  color: #7356c5 !important;
  font-size: 0.63rem !important;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  color: #292440;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 630;
  line-height: 1;
  letter-spacing: -0.055em;
}

.auth-card header > p:last-child {
  max-width: 43ch;
  margin: 13px 0 0;
  color: #6f6980;
  font-size: 0.72rem;
  line-height: 1.58;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form > label {
  display: grid;
  gap: 7px;
}

.auth-form > label > span {
  color: #494257;
  font-size: 0.64rem;
  font-weight: 780;
}

.auth-form input:not([type="checkbox"]),
.auth-form select {
  width: 100%;
  height: 51px;
  padding: 0 17px;
  border: 1px solid rgba(83, 73, 115, 0.16);
  border-radius: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.88);
  color: #292440;
  font: inherit;
  font-size: 0.75rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:not([type="checkbox"]):focus,
.auth-form select:focus {
  border-color: rgba(116, 78, 199, 0.56);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(120, 91, 205, 0.11), 0 10px 30px rgba(71, 56, 115, 0.08);
}

.auth-form input::placeholder {
  color: #aaa4b5;
}

.auth-form label small {
  color: #81798e;
  font-size: 0.59rem;
  line-height: 1.45;
}

.auth-form__match:empty { display: none; }
.auth-form__match.is-error { color: #a23559; font-weight: 720; }
.auth-form input[aria-invalid="true"] {
  border-color: rgba(186, 63, 102, 0.52);
  box-shadow: 0 0 0 3px rgba(186, 63, 102, 0.09);
}

.auth-form__hint {
  margin-top: -8px;
  color: #81798e;
  font-size: 0.57rem;
  line-height: 1.45;
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
  font-size: 0.62rem;
}

.auth-form__row a,
.auth-switch a {
  color: #6444ba;
  font-weight: 790;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6c6578;
}

.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: #7654ce;
}

.auth-check--terms {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  padding: 13px 14px;
  border: 1px solid rgba(83, 73, 115, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.42);
  line-height: 1.55;
}

.auth-check--terms input { margin-top: 3px; }
.auth-check--terms a { color: #6444ba; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.auth-privacy-note { margin: 0; color: #81798e; font-size: 0.59rem; line-height: 1.55; }

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 3px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  background: linear-gradient(105deg, #5048ac, #7954cf 46%, #c95aa8);
  box-shadow: 0 16px 34px rgba(94, 64, 174, 0.25), inset 0 1px rgba(255, 255, 255, 0.42);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 820;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
  box-shadow: 0 20px 40px rgba(94, 64, 174, 0.34), inset 0 1px rgba(255, 255, 255, 0.48);
  transform: translateY(-2px);
}

.auth-submit span {
  font-size: 1rem;
}

:root[data-theme="dark"] .auth-portal {
  background:
    radial-gradient(circle at 14% 8%, rgba(56, 139, 190, 0.22), transparent 30%),
    radial-gradient(circle at 78% 88%, rgba(130, 67, 154, 0.22), transparent 34%),
    linear-gradient(142deg, #080c13 0%, #101728 45%, #171326 72%, #090b10 100%);
}

:root[data-theme="dark"] .auth-portal::after {
  background-image: linear-gradient(rgba(147, 190, 235, 0.07) 1px, transparent 1px);
}

:root[data-theme="dark"] .auth-portal__grid {
  border-color: rgba(152, 184, 226, 0.14);
  background: rgba(10, 14, 22, 0.6);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.48),
    inset 0 1px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .auth-card-wrap {
  background:
    radial-gradient(circle at 100% 0%, rgba(76, 137, 201, 0.14), transparent 22rem),
    linear-gradient(145deg, rgba(20, 25, 37, 0.98), rgba(13, 16, 25, 0.96));
}

:root[data-theme="dark"] .auth-card h1,
:root[data-theme="dark"] .auth-form > label > span {
  color: var(--text);
}

:root[data-theme="dark"] .auth-card header > p:last-child,
:root[data-theme="dark"] .auth-form label small,
:root[data-theme="dark"] .auth-form__hint,
:root[data-theme="dark"] .auth-check,
:root[data-theme="dark"] .auth-switch,
:root[data-theme="dark"] .auth-price-note {
  color: var(--muted);
}

:root[data-theme="dark"] .auth-form input:not([type="checkbox"]),
:root[data-theme="dark"] .auth-form select {
  border-color: rgba(150, 177, 218, 0.17);
  background: var(--field-bg);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  color: var(--text);
}

:root[data-theme="dark"] .auth-form input:not([type="checkbox"]):focus,
:root[data-theme="dark"] .auth-form select:focus {
  border-color: rgba(117, 170, 239, 0.58);
  background: linear-gradient(145deg, rgba(27, 37, 53, 0.98), rgba(17, 22, 34, 0.98));
  box-shadow: 0 0 0 4px rgba(92, 156, 224, 0.12), 0 14px 38px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .auth-form input::placeholder {
  color: #747e91;
}

:root[data-theme="dark"] .auth-story > img {
  border-color: rgba(161, 206, 235, 0.18);
  background: rgba(13, 19, 29, 0.7);
}

:root[data-theme="dark"] .payment-error {
  border-color: rgba(255, 151, 124, 0.2);
  background: rgba(91, 42, 37, 0.48);
  color: #ffe5dc;
}

:root[data-theme="dark"] .payment-error__icon {
  background: rgba(255, 255, 255, 0.09);
  color: #ff9c83;
}

:root[data-theme="dark"] .payment-error p,
:root[data-theme="dark"] .payment-error code {
  color: #ddb2a7;
}

:root[data-theme="dark"] .payment-support-button {
  border-color: rgba(208, 198, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
  color: #e1dcff;
}

:root[data-theme="dark"] .payment-support-button:hover {
  border-color: rgba(208, 198, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 15px;
  color: #9992a3;
  font-size: 0.59rem;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: rgba(89, 78, 115, 0.12);
  content: "";
}

.auth-provider {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(80, 71, 107, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.55);
  color: #393346;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 770;
}

.auth-provider--disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-provider__copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.auth-provider__copy strong {
  font-size: 0.68rem;
}

.auth-provider__copy small {
  color: #777080;
  font-size: 0.56rem;
  font-weight: 650;
}

.auth-provider__google {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  box-shadow: inset 0 0 0 6px #fff;
  color: transparent;
}

.auth-switch,
.auth-price-note {
  margin: 22px 0 0;
  color: #777080;
  font-size: 0.63rem;
  text-align: center;
}

.auth-price-note {
  margin-top: 15px;
  line-height: 1.5;
}

.auth-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 13px;
  font-size: 0.64rem;
  line-height: 1.5;
}

.auth-notice--error {
  border-color: rgba(186, 63, 102, 0.2);
  background: rgba(255, 232, 240, 0.72);
  color: #9c3157;
}

.auth-notice--success {
  border-color: rgba(39, 148, 122, 0.2);
  background: rgba(226, 250, 243, 0.72);
  color: #267b67;
}

.auth-code {
  font-size: 1.05rem !important;
  font-weight: 790 !important;
  letter-spacing: 0.18em;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-portal__aurora--one { animation: auth-float 12s ease-in-out infinite alternate; }
  .auth-portal__aurora--two { animation: auth-float 15s ease-in-out infinite alternate-reverse; }
}

@keyframes auth-float {
  to { transform: translate3d(3vw, -2vw, 0) rotate(7deg); }
}

@media (max-width: 840px) {
  .auth-portal__grid { grid-template-columns: minmax(0, 1fr); width: min(560px, 100%); }
  .auth-card-wrap { min-height: 650px; }
}

@media (max-width: 560px) {
  .auth-portal { padding: 18px 14px 32px; }
  .auth-portal__grid { border-radius: 28px; }
  .auth-card-wrap { min-height: 0; padding: 38px 24px 42px; }
  .auth-card__logo { width: 100%; margin-bottom: 32px; }
  .auth-form__row { align-items: flex-start; flex-direction: column; gap: 9px; }
}

/* Registration is a clear second action when a workshop asks for sign-in. */
.auth-switch:has(a[href^="/registreren"]) { display: grid; justify-items: stretch; gap: 10px; text-align: center; }
.auth-switch a[href^="/registreren"] { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-strong); color: var(--sapphire); font-weight: 650; text-decoration: none; }
.auth-switch a[href^="/registreren"]:hover { border-color: var(--sapphire); background: var(--surface-blue); }
