/*
 * Sign-in screen.
 *
 * Visually separate from the rest of the panel on purpose: a dark card floating
 * on a violet field, following the Artiroute sign-in. It is the only page an
 * unauthenticated visitor sees, so it carries the product's name rather than
 * its chrome.
 *
 * Sizes here are in rem and inherit the fluid root from ui.css, so the card
 * grows on a large display along with everything else.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --auth-card: #1b1c24;
  --auth-card-line: rgba(255, 255, 255, 0.09);
  --auth-field: #24252f;
  --auth-field-line: rgba(255, 255, 255, 0.12);
  --auth-text: #f5f6fa;
  --auth-muted: #9aa1b1;
  --auth-accent: #818cf8;
  --auth-accent-strong: #6f7bf7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, 0.35vw + 10.5px, 18px);
}

body.auth {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color: var(--auth-text);
  /* The lighter corner sits behind the card so the dark panel has something to
     lift off, rather than floating on a flat wash. */
  background:
    radial-gradient(120% 90% at 82% 62%, rgba(150, 150, 255, 0.42) 0%, transparent 58%),
    linear-gradient(135deg, #3f34c4 0%, #4f46e5 42%, #6d6bf6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 2rem 2.5rem;
  gap: 1.5rem;
}

/* -------------------------------------------------------------- brand row */

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.auth-mark {
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  color: #3f34c4;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.auth-wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------- content */

.auth-main {
  display: grid;
  grid-template-columns: 1fr minmax(20rem, 24rem);
  align-items: center;
  gap: 3rem;
}
/* Below roughly a laptop width the illustration is the first thing to go: the
   form has to stay reachable without scrolling. */
@media (max-width: 62rem) {
  .auth-main {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .auth-art {
    display: none;
  }
}

.auth-art {
  display: flex;
  justify-content: center;
  opacity: 0.9;
}
.auth-art svg {
  width: min(34rem, 100%);
  height: auto;
}

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

.auth-card {
  width: 100%;
  border-radius: 0.875rem;
  background: var(--auth-card);
  border: 1px solid var(--auth-card-line);
  box-shadow: 0 30px 70px -30px rgba(10, 12, 40, 0.7);
  overflow: hidden;
}
.auth-card-head {
  padding: 1.5rem 1.5rem 0;
}
.auth-title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.auth-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  border-bottom: 1px solid var(--auth-card-line);
}
.auth-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: none;
  color: var(--auth-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  position: relative;
  transition: color 150ms ease;
}
.auth-tab:hover {
  color: var(--auth-text);
}
.auth-tab[aria-selected='true'] {
  color: var(--auth-accent);
}
.auth-tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--auth-accent);
}
.auth-tab svg {
  width: 1rem;
  height: 1rem;
}

.auth-body {
  padding: 1.5rem;
}
.auth-panel[hidden] {
  display: none;
}

.auth-field {
  margin-bottom: 1rem;
}
.auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--auth-text);
}
.auth-field input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--auth-field-line);
  background: var(--auth-field);
  color: var(--auth-text);
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-field input::placeholder {
  color: #6f7585;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
}

.auth-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--auth-accent);
  color: #14152a;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6875rem 1rem;
  cursor: pointer;
  transition: background 150ms ease;
}
.auth-submit:hover {
  background: var(--auth-accent-strong);
  color: #fff;
}
.auth-submit svg {
  width: 1rem;
  height: 1rem;
}

.auth-error {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
}
.auth-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--auth-muted);
}

/* ---------------------------------------------------------------- footer */

.auth-bottom {
  max-width: 46rem;
}
.auth-headline {
  margin: 0;
  font-size: clamp(1.75rem, 2.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.auth-tagline {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.78);
}
