/* Inter is served from here rather than fetched from Google, as in the app and the
   site: no other site is contacted when someone signs in. The same files and ranges
   as @fontsource-variable/inter; the licence is fonts/OFL.txt. */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------------------------------------------------------------------------
   DESIGN TOKENS (Sprumble light)
   The same palette as the @theme block in app/src/index.css: a pale ground, white
   cards, blue and purple accents. Declared on :root here because this project has
   no Tailwind. The names are kept from the shared identity layout.
   --------------------------------------------------------------------------- */
:root {
  --color-night: #f8f9fc;
  --color-depth-blue: rgba(59, 130, 246, 0.06);
  --color-depth-green: rgba(139, 92, 246, 0.06);
  --color-card: #ffffff;
  --color-card-head: #f8f9fc;
  --color-card-solid: #ffffff;
  --color-edge: #e5e7eb;
  --color-rule: #f3f4f6;
  --color-text: #111827;
  --color-text-soft: #6b7280;
  --color-text-faint: #9ca3af;
  --color-sea: #3b82f6;
  --color-sea-deep: #2563eb;
  --color-sky: #8b5cf6;
  --color-amber: #f97316;
  --color-danger: #ef4444;
  --color-field: #ffffff;
  --color-on-accent: #ffffff;

  --font-sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* ------------------------------- END TOKENS ------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

/* The pale ground with the app's soft blue, purple and teal washes. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-on-accent);
  background-image:
    radial-gradient(at 20% 0%, var(--color-depth-blue) 0%, transparent 50%),
    radial-gradient(at 80% 100%, var(--color-depth-green) 0%, transparent 50%),
    radial-gradient(at 0% 80%, rgba(20, 184, 166, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--color-sea);
  color: var(--color-on-accent);
}

:focus-visible {
  outline: 2px solid var(--color-sea);
  outline-offset: 2px;
}

a {
  color: var(--color-sea);
}

a:hover {
  color: var(--color-sea-deep);
}

/* A small secondary line. */
.label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text-faint);
}

/* ---------------------------------- Header --------------------------------- */

/* Lighter than the app's bar: the mark and the name alone on the ground. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
  color: var(--color-text);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--color-text);
}

.wordmark svg {
  flex-shrink: 0;
}

/* ---------------------------------- Shell ---------------------------------- */

/* One wide card, centred in the viewport. */
main.auth-shell {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding: 1rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  main.auth-shell {
    padding: 2.5rem 1.5rem;
  }
}

.auth-card {
  width: 100%;
  max-width: 1040px;
  border: 1px solid var(--color-edge);
  border-radius: 24px;
  /* The app's card shadow: a faint blue lift. */
  box-shadow: 0 4px 24px -4px rgba(59, 130, 246, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .auth-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.auth-card--single {
  max-width: 30rem;
  grid-template-columns: minmax(0, 1fr);
}

/* The form column, on the solid panel. */
.auth-form {
  background-color: var(--color-card-solid);
  padding: 28px 24px;
  min-width: 0;
}

@media (min-width: 640px) {
  .auth-form {
    padding: 36px 40px;
  }
}

/* The brand column, tinted with the logo's blue and purple, with a rule on its left
   (above it when stacked). */
.auth-brand {
  background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(139, 92, 246, 0.06));
  border-top: 1px solid var(--color-rule);
  padding: 28px 24px;
  min-width: 0;
  display: flex;
}

@media (min-width: 640px) {
  .auth-brand {
    padding: 40px;
  }
}

@media (min-width: 900px) {
  .auth-brand {
    border-top: 0;
    border-left: 1px solid var(--color-rule);
  }
}

/* ---------------------------------- Panel ---------------------------------- */

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.card-head__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card-sub {
  font-size: 13px;
  color: var(--color-text-soft);
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------------------------------- Forms ---------------------------------- */

.form-group {
  margin-bottom: 1rem;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-soft);
  display: block;
  margin-bottom: 6px;
}

input[type='email'],
input[type='password'],
input[type='text'] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-edge);
  border-radius: 9px;
  background-color: var(--color-field);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms linear;
}

input::placeholder {
  color: var(--color-text-faint);
}

input[type='email']:focus,
input[type='password']:focus,
input[type='text']:focus {
  border-color: var(--color-sea);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background-color: var(--color-sea);
  color: var(--color-on-accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms linear, color 120ms linear;
}

.btn:hover {
  background-color: var(--color-sea-deep);
  color: var(--color-on-accent);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn--inline {
  width: auto;
}

/* Quiet button for the passkey actions: a pale grey with an edge, not filled. */
.btn--ghost {
  background-color: #f1f3f9;
  border: 1px solid var(--color-edge);
  color: var(--color-text);
}

.btn--ghost:hover {
  background-color: #e5e7eb;
  color: var(--color-text);
}

/* The passkey section on the profile page. */
.passkey__hint {
  margin: 0 0 1rem;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.passkey__status {
  display: block;
  margin-top: 0.75rem;
  font-size: 13px;
}

/* "or" separator between the password form and the passkey button. */
/* A label with a link at the far end, such as Forgot your password? */
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.label-row__link {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-sea);
  text-decoration: none;
}

.label-row__link:hover {
  color: var(--color-sea-deep);
  text-decoration: underline;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-faint);
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--color-text-faint);
  font-size: 12px;
  font-weight: 500;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--color-rule);
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.remember input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--color-sea);
  cursor: pointer;
}

.remember label {
  margin: 0;
  cursor: pointer;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 400;
}

.alt {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
  font-size: 14px;
  color: var(--color-text-soft);
}

.alt a {
  color: var(--color-sea);
  font-weight: 600;
  text-decoration: none;
}

.alt a:hover {
  color: var(--color-sea-deep);
  text-decoration: underline;
}

/* -------------------------------- Validation ------------------------------- */

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-danger);
}

.field-error:empty {
  display: none;
}

.validation-summary-errors {
  margin-bottom: 1rem;
  padding: 10px 14px;
  border-radius: 10px;
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--color-danger);
  font-size: 13px;
}

.validation-summary-errors ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.validation-summary-valid {
  display: none;
}

/* ------------------------------- Brand panel ------------------------------- */

.brand-panel {
  width: 100%;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.brand-panel__wordmark {
  font-size: 24px;
  margin-bottom: 1.25rem;
}

.brand-panel__kicker {
  color: var(--color-text-soft);
  font-size: 13px;
  display: block;
  margin-bottom: 0.5rem;
}

.brand-panel__line {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: 30px;
  margin: 0;
}

.brand-panel__chart {
  width: 100%;
  height: 180px;
}

.brand-panel__chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes bpDraw {
  from {
    stroke-dashoffset: var(--len);
  }
  to {
    stroke-dashoffset: 0;
  }
}

.brand-panel__fitness {
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  --len: 520;
  animation: bpDraw 1400ms cubic-bezier(0.4, 0, 0.2, 1) 120ms forwards;
}

.brand-panel__form {
  opacity: 0;
  animation: bpFade 700ms ease-out 1000ms forwards;
}

.brand-panel__area {
  opacity: 0;
  animation: bpFade 900ms ease-out 700ms forwards;
}

@keyframes bpFade {
  to {
    opacity: 1;
  }
}

.brand-panel__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: auto 0 0;
}

.brand-panel__stats .label {
  color: var(--color-text-faint);
  margin-bottom: 4px;
}

.brand-panel__stats dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.brand-panel__form-value {
  color: var(--color-sea);
}

@media (prefers-reduced-motion: reduce) {
  .brand-panel__fitness,
  .brand-panel__form,
  .brand-panel__area {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* --------------------------------- Profile --------------------------------- */

.status-message {
  margin-bottom: 1rem;
  padding: 10px 14px;
  border-radius: 10px;
  background-color: rgba(59, 130, 246, 0.08);
  color: var(--color-sea);
  font-size: 13px;
}

.account-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-rule);
}

.account-meta dt {
  margin-bottom: 4px;
}

.account-meta dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

.account-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.account-actions__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-sea);
  text-decoration: none;
}

.account-actions__back:hover {
  color: var(--color-sea-deep);
}

.account-actions__out {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-faint);
  text-decoration: none;
}

.account-actions__out:hover {
  color: var(--color-danger);
}

/* ---------------------------------- Error ---------------------------------- */

.error-copy {
  color: var(--color-text-soft);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

/* ------------------------------ Profile picture ----------------------------- */

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-depth-blue);
  border: 1px solid var(--color-edge);
}

.avatar-img--empty {
  display: inline-block;
}

.avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.avatar-controls input[type="file"] {
  color: var(--color-text-soft);
  font-size: 13px;
}

/* Removes the picture from inside the hint, without looking like a second button. */
.link-button {
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-text-soft);
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--color-danger);
}

.passkey-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-rule);
  border-radius: 10px;
}

.passkey-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 14px;
}

.passkey-list__item + .passkey-list__item {
  border-top: 1px solid var(--color-rule);
}

.passkey-list__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.passkey-list__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.passkey-list__added {
  font-size: 12px;
  color: var(--color-text-faint);
}

.passkey-list__item .link-button {
  margin: 0;
  font-size: 13px;
}

/* -------------------------------- Profile tabs ------------------------------ */

.tabs {
  display: flex;
  gap: 1.5rem;
  margin: -0.25rem 0 1.25rem;
  border-bottom: 1px solid var(--color-rule);
}

.tab {
  margin-bottom: -1px;
  padding: 0 0 10px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-faint);
  text-decoration: none;
}

.tab:hover {
  color: var(--color-text);
}

.tab--active {
  color: var(--color-text);
  border-bottom-color: var(--color-sea);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.section-title--spaced {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-rule);
}

/* Who runs Sprumble, and the way to the privacy notice and the terms, under the card:
   the same sign-off as the app's footer. */
.auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 2.5rem;
}

.auth-footer__row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.auth-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.auth-footer__divider {
  width: 1px;
  height: 1rem;
  background: var(--color-edge);
}

.auth-footer__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.auth-footer__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-soft);
  text-decoration: none;
  transition: color 120ms linear;
}

.auth-footer__links a:hover {
  color: var(--color-text);
}

.auth-footer__small {
  margin: 0.75rem 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-faint);
}

.auth-footer__small a {
  color: inherit;
  text-decoration: none;
}

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

/* The line under Create account that points to the terms and the privacy notice. */
.consent {
  margin: 0.875rem 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-faint);
}
