/* --- AUTH — signin & signup --- */

/* --- Page logo (fixed top-left) --- */

.page-logo {
  position: fixed;
  top: 2rem;
  left: 2.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 27px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1;
  text-decoration: none;
}

.page-logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.page-logo .logo-pixel {
  fill: var(--text);
  animation: logoPixelFill 0.18s ease-out forwards;
  animation-delay: calc(0.3s + var(--d, 0s));
}

@keyframes logoPixelFill {
  to {
    fill: var(--accent);
  }
}

.page-logo .logo-eye {
  fill: #000;
}

.page-logo .logo-eye.blink {
  fill: var(--accent);
}

/* --- Layout --- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
  opacity: 0;
  animation: authFadeIn 0.8s cubic-bezier(0.16, 1, 0.6, 1) 0.1s forwards;
}

.auth-wrapper--centered {
  grid-template-columns: 1fr;
  max-width: 440px;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- The signup page's headline and its texts --- */

.promo-heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 200;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 1.2rem;
}

.promo-text {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* --- Auth card --- */

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  padding: 3rem 2.5rem;
}

.auth-heading {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 200;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* --- Form --- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input::placeholder {
  color: var(--dim);
}

/* As the console's fields (.date-range-input, .results-input): brighter under the
   pointer; a focused field keeps the accent */
.form-input:hover:not(:focus, :disabled) {
  border-color: rgba(255, 255, 255, 0.2);
}

.form-input:focus {
  border-color: var(--accent);
}

/* --- Password toggle --- */

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}

.password-toggle:hover {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.88);
  transition: transform 0.1s ease;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.password-toggle .icon-eye-off {
  position: absolute;
  opacity: 0;
  transform: scale(0.8);
}

.password-toggle.active .icon-eye {
  opacity: 0;
  transform: scale(0.8);
}

.password-toggle.active .icon-eye-off {
  opacity: 1;
  transform: scale(1);
}

.password-toggle.active {
  color: var(--accent);
}

/* --- Checkbox --- */

.form-group--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--bg-hover);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.form-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* The check (Lucide's), drawn from left to right as the box is ticked, as the
   Firmenatlas' checkboxes do (registry.css). Only ticking animates: the transition
   sits on the checked state, so unticking clears it at once, and a box rendered
   ticked shows its check without drawing it. */
.form-checkbox::after {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  clip-path: inset(0 100% 0 0);
}

.form-checkbox:checked::after {
  clip-path: inset(0);
  transition: clip-path 0.3s cubic-bezier(0.65, 0, 0.35, 1) 0.05s;
}

@media (prefers-reduced-motion: reduce) {
  .form-checkbox:checked::after {
    transition: none;
  }
}

.form-checkbox-label {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--muted);
  cursor: pointer;
}

/* --- Row layout (remember me + forgot password) --- */

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--muted);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* --- Google sign-in (the buttons themselves: buttons.css) --- */

.btn-oauth {
  width: 100%;
  height: 3.2rem;
  padding: 0 2rem;
  border-radius: var(--radius-control);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none; /* a link to /auth/google/start/, styled as a button */
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.btn-oauth:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Divider --- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Switch link --- */
.auth-switch {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--muted);
}

.auth-switch a {
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* --- Notices and hints --- */

/* No display here: a display value would override the notice's [hidden] */
.auth-notice {
  margin-bottom: 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-surface);
  background: var(--accent-dim);
}

.auth-notice-title {
  color: var(--text);
  font-weight: 500;
}

.auth-notice .btn {
  margin-top: 1rem;
}

.auth-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .page-logo {
    top: 1.2rem;
    left: 1.5rem;
  }

  .auth-page {
    padding: 5rem 1rem 2rem;
  }

  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }
}

/* An ordinary text field for simple form-filling bots; outside keyboard and screen-reader flow. */
.signup-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Signup: the form beside the example list (live-list.css) ---
 * From 1280px the page splits in two equal halves: on the left a panel with the
 * headline and the example list, which runs off the panel's right and bottom edges,
 * on a grid of small squares in the accent that fades in towards the list; on the
 * right the form, on the page's own background, without a card's frame: the halves
 * are the frame. Narrower, the list's columns no longer fit at 10px: the form stands
 * alone in its card, as on the other sign-in pages, and the list stands still
 * (live-list.js).
 */

.auth-wrapper--split {
  grid-template-columns: minmax(0, 1fr);
  max-width: 440px;
}

.signup-showcase {
  display: none;
}

@media (min-width: 1280px) {
  .auth-page--split {
    display: block;
    padding: 0;
  }

  .auth-wrapper--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    max-width: none;
    min-height: 100vh;
  }

  /* The text and the list start under the page logo's left edge (2.5rem), the text
     at --text-top. */
  .signup-showcase {
    --text-top: clamp(7.5rem, 17vh, 11rem);
    position: relative;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: var(--text-top) 0 0 2.5rem;
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--text) 1.5%, var(--bg));
  }

  /* The grid behind the list: a 3px square every 12px in the accent. It reaches up
     only to where the text starts, fading in from there to full strength at about
     the list's top, so it frames the list (the left margin, the band above it)
     without pulling the eye from the form. */
  .signup-showcase::before {
    content: "";
    position: absolute;
    inset: calc(var(--text-top) + 9rem) 0 0;
    background-position: 0 calc(-1 * (var(--text-top) + 9rem));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Crect x='4' y='0' width='3.2' height='3.2' fill='%23ff6a00' fill-opacity='0.24'/%3E%3C/svg%3E");
    mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4) 7rem, #000 14rem);
    pointer-events: none;
  }

  .signup-showcase-text,
  .signup-showcase .live-list {
    position: relative;
  }

  .signup-showcase-text {
    max-width: 36rem;
    padding-right: 2.5rem;
    margin-bottom: clamp(2rem, 6vh, 3.5rem);
  }

  /* No word alone on the sentence's last line; "ohne Abo." also keeps together in
     the text itself */
  .signup-showcase-text .promo-text {
    margin-bottom: 0;
    text-wrap: pretty;
  }

  /* The list fills the rest of the panel. Its scale (--u, its font size) lets every
     column fit the panel's width, between 10px and 0.8rem. */
  .signup-showcase .live-list {
    --u: clamp(10px, 100cqi / 60, 0.8rem);
    flex: 1;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-top-left-radius: var(--radius-dialog);
    background: var(--bg);
  }

  /* Centred in the window's height, so the padding above and below is only the least
     room left at the edges: 6rem made the page scroll in a full-HD browser window once
     Google's button stood under the form (2026-11-21). */
  .auth-wrapper--split .auth-card {
    align-self: center;
    justify-self: center;
    width: 100%;
    max-width: 38rem;
    padding: 2.5rem clamp(2rem, 4vw, 4rem);
    border: 0;
    background: none;
  }
}
