/* ═══════════════════════════════════════════════════════════════
   Tomasetti portal-gate login — unified purple-on-white (2026-08-04)
   All portals share one look: white background, Tomasetti purple
   accent (#6d28d9 / #7c3aed / #4c1d95), Outfit + Nunito.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --ink: #12151c;
  --muted: rgba(18, 21, 28, 0.62);
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(18, 21, 28, 0.12);
  --brand: #6d28d9;
  --brand-hot: #7c3aed;
  --brand-deep: #4c1d95;
  --glow-a: rgba(124, 58, 237, 0.18);
  --glow-b: rgba(168, 85, 247, 0.14);
  --danger: #b91c1c;
  --danger-bg: #fde8e8;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 55% at 12% -10%, var(--glow-a), transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 0%, var(--glow-b), transparent 50%),
    #f9f7fb;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(109, 40, 217, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 40, 217, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 24px, -24px 48px; }
}

.card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 2rem 1.75rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.10);
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}

h1 {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.error {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  color: var(--danger);
  font-weight: 700;
}

form {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.35rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.92rem;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1.05rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

button {
  margin-top: 0.25rem;
  min-height: 3.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #f8fafc;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

button:hover { background: var(--brand-hot); transform: translateY(-1px); }
button:active { transform: translateY(0); }

.hint {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Mobile-first: no iOS/Android default chrome ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  -webkit-tap-highlight-color: transparent;
}
input, button {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 10px;
  touch-action: manipulation;
}
input {
  font-size: 1rem;
}

/* iOS/Chrome autofill: keep the themed background instead of default yellow */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out;
  caret-color: var(--ink);
}

/* Tactile press feedback */
button:active {
  transform: translateY(1px) scale(0.98);
}

/* Focus visible (keep accessible) */
:where(input, button):focus-visible {
  outline: 3px solid var(--brand-deep);
  outline-offset: 2px;
}

/* ── Small screens (phones) ── */
@media (max-width: 480px) {
  body {
    padding: max(1.25rem, env(safe-area-inset-top))
             max(1rem, env(safe-area-inset-right))
             max(1.5rem, env(safe-area-inset-bottom))
             max(1rem, env(safe-area-inset-left));
    place-items: start center;
  }
  .card {
    width: min(100%, 400px);
    margin-top: 2vh;
    padding: 1.7rem 1.4rem 1.4rem;
    border-radius: 20px;
  }
  h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }
  label {
    font-size: 0.86rem;
  }
  input {
    min-height: 3.1rem;
    font-size: 1.05rem;
  }
  button {
    min-height: 3.3rem;
    font-size: 1.1rem;
  }
  .eyebrow {
    font-size: 0.7rem;
  }
  .sky {
    animation: none;
  }
}

@media (max-width: 360px) {
  body { padding-inline: 0.75rem; }
  .card { padding: 1.5rem 1.1rem 1.25rem; }
  .lede { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .card, button { animation: none; transition: none; }
  button:hover, button:active { transform: none; }
}
