/* Styles the login and signup pages with the public KioskGrid brand system. */
:root {
  --ink: #14213d;
  --muted: #5b6578;
  --line: #dce4ef;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --soft-blue: #e8f3ff;
  --blue: #1668e3;
  --blue-dark: #0f4fb4;
  --teal: #10a6a6;
  --green: #2ca66f;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(20, 33, 61, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(22, 104, 227, 0.1), transparent 30%),
    radial-gradient(circle at 86% 76%, rgba(16, 166, 166, 0.12), transparent 32%),
    linear-gradient(145deg, #ffffff 0%, #f6f9fd 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  color: var(--blue-dark);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px 18px;
}

.auth-card {
  width: min(100%, 468px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
}

.auth-logo-orbit {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  background: var(--soft-blue);
}

.auth-logo-mark {
  display: block;
  width: 42px;
  height: 42px;
  animation: logoSettle 780ms cubic-bezier(0.2, 0.85, 0.26, 1.16) both;
  transform-origin: 50% 58%;
}

.auth-heading {
  margin-top: 24px;
}

.auth-eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 7vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 650;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: #8a96a8;
  font-weight: 550;
}

.field input:focus {
  border-color: var(--blue);
  background: #fbfdff;
  box-shadow: 0 0 0 4px rgba(22, 104, 227, 0.13);
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  min-height: 0;
  margin-top: 0;
  padding-top: 0;
}

.turnstile-wrap:empty {
  display: none;
}

.turnstile-wrap:has(.cf-turnstile > *) {
  min-height: 80px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid #cfdbea;
}

.turnstile-wrap .cf-turnstile {
  max-width: 100%;
}

.auth-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
}

.auth-status-error {
  color: var(--danger);
  background: #fff0ed;
}

.auth-status-info {
  color: var(--blue-dark);
  background: var(--soft-blue);
}

.btn,
.auth-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 16px 32px rgba(22, 104, 227, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn:hover,
.auth-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 18px 36px rgba(22, 104, 227, 0.26);
  transform: translateY(-1px);
}

.btn:disabled,
.auth-primary:disabled,
.auth-form :disabled {
  cursor: wait;
  opacity: 0.68;
}

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

.terms-control {
  position: relative;
  margin-top: 1px;
}

.terms-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.terms-control label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.terms-check {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #b7c6d8;
  border-radius: 7px;
  background: #ffffff;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.terms-check::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 6px;
  height: 12px;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(40deg) scale(0.7);
  transform-origin: 58% 58%;
  transition: opacity 160ms ease, transform 160ms ease;
}

.terms-control input:focus-visible + label .terms-check {
  box-shadow: 0 0 0 4px rgba(22, 104, 227, 0.13);
}

.terms-control input:checked + label .terms-check {
  border-color: var(--green);
  background: var(--green);
}

.terms-control input:checked + label .terms-check::after {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(40deg) scale(1);
}

@keyframes logoSettle {
  0% {
    opacity: 0;
    transform: perspective(220px) rotateY(-70deg) rotate(-18deg) scale(0.82);
  }
  58% {
    opacity: 1;
    transform: perspective(220px) rotateY(14deg) rotate(5deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: perspective(220px) rotateY(0) rotate(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    align-items: start;
    padding: 18px 14px;
  }

  .auth-card {
    padding: 24px;
    box-shadow: 0 18px 44px rgba(20, 33, 61, 0.1);
  }

  .auth-logo-orbit {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .auth-logo-mark {
    width: 36px;
    height: 36px;
  }

  .auth-brand {
    font-size: 21px;
  }

  .auth-heading {
    margin-top: 22px;
  }

  .auth-form {
    margin-top: 24px;
  }
}

@media (max-height: 760px) {
  .auth-shell {
    align-items: start;
    padding-top: 18px;
    padding-bottom: 18px;
  }
}
