/* Tuli Trumm — allauth account pages (design system §05 forms) */

.site-main--auth {
  display: flex;
  flex-direction: column;
}

.auth-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(440px, calc(100% - 2rem));
  max-width: 100%;
  margin-inline: auto;
  min-height: calc(100vh - var(--nav-height) - 10rem);
  padding: 2rem 0 3rem;
}

.page-auth--manage .auth-page {
  width: var(--wrap);
  max-width: calc(100% - 2rem);
  align-items: flex-start;
  padding-top: 1.5rem;
}

.auth-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 40px -28px var(--shadow);
  overflow: hidden;
}

.auth-card--manage {
  max-width: none;
}

.auth-card__body {
  padding: 1.75rem 1.85rem 1.9rem;
}

.auth-card--entrance .auth-card__body {
  text-align: center;
}

.auth-card--entrance .auth-card__body form,
.auth-card--entrance .auth-card__body .auth-provider-list,
.auth-card--entrance .auth-card__body ul:has(.auth-provider) {
  text-align: left;
}

.auth-card__brand {
  display: flex;
  justify-content: center;
  padding: 1.35rem 1.85rem 0.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg2), var(--surface));
}

.auth-card__brand img {
  width: 56px;
  height: 56px;
}

.auth-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.auth-layout--manage {
  grid-template-columns: 260px minmax(0, 1fr);
}

.auth-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 34px -28px var(--shadow);
}

.auth-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.auth-sidebar__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.auth-sidebar__avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--flame);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-sidebar__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.2;
}

.auth-sidebar__email {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-all;
}

.auth-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-sidebar__link:hover {
  background: var(--bg2);
  color: var(--ink);
}

.auth-sidebar__link.is-active {
  background: rgba(224, 101, 74, 0.1);
  color: var(--primary);
}

.auth-sidebar__link--muted { margin-top: 0.35rem; }

.auth-sidebar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
}

.auth-sidebar__back:hover { color: var(--ink); }

.auth-card h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  line-height: 1.15;
  color: var(--ink);
}

.auth-card--manage h1,
.auth-card--manage p {
  text-align: left;
}

.auth-card h2 {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.auth-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-card p a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-card hr {
  margin: 1.25rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Forms (design system §05) ── */
.auth-card form,
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-card form p,
.profile-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  text-align: left;
}

.auth-card form label,
.profile-form label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ink);
}

.auth-card form input[type="email"],
.auth-card form input[type="password"],
.auth-card form input[type="text"],
.auth-card form input[type="file"],
.auth-card form textarea,
.profile-form__field input {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-card form textarea {
  height: auto;
  min-height: 120px;
  padding: 0.75rem 1rem;
  resize: vertical;
}

.auth-card form input:focus,
.auth-card form textarea:focus,
.profile-form__field input:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 22%, transparent);
}

.auth-card form p:has(.errorlist) input,
.auth-card form p:has(.errorlist) textarea {
  border: 1.5px solid var(--drum);
  background: color-mix(in srgb, var(--drum) 7%, var(--surface));
}

.auth-card form input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.auth-card form p:has(input[type="checkbox"]) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.auth-card form p:has(input[type="checkbox"]) label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  order: 1;
}

.auth-card form input[type="radio"] {
  width: auto;
  margin-right: 0.45rem;
  accent-color: var(--primary);
}

.auth-card form p:has(input[type="radio"]) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.auth-card form ul.errorlist,
.profile-form .errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--drum);
  font-size: 0.8125rem;
}

.auth-card form .helptext,
.auth-card form p span.helptext {
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-card form .helptext a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-card form .helptext a:hover {
  text-decoration: underline;
}

.auth-card form button[type="submit"],
.auth-card button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 48px;
  margin-top: 0.25rem;
  padding: 0 1.35rem;
  border: none;
  border-radius: 13px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 22px -12px var(--primary);
}

.auth-card form button[type="submit"]:hover,
.auth-card button[type="submit"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.auth-card form a,
.auth-card form button[type="submit"][form="logout-from-stage"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  box-shadow: none;
  min-height: auto;
  width: auto;
  padding: 0;
}

.auth-card form a:hover,
.auth-card form button[type="submit"][form="logout-from-stage"]:hover {
  color: var(--primary);
  transform: none;
  filter: none;
}

.auth-card strong {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.auth-provider-list,
.auth-card ul:has(.auth-provider) {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-provider__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.auth-provider__btn:hover {
  border-color: var(--primary);
  background: var(--bg2);
  transform: translateY(-1px);
}

.auth-provider--google .auth-provider__btn {
  border-color: #dadce0;
}

/* Profile form */
.profile-form {
  margin-top: 0.5rem;
  width: 100%;
  max-width: none;
}

.profile-form__avatar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg2);
}

.profile-form__avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--flame);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.profile-form__avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-form__avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 2rem;
}

.profile-form__avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.profile-form__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-form__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.profile-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.profile-form__submit {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 1.35rem;
  border: none;
  border-radius: 13px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px var(--primary);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.profile-form__submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar--initials {
  background: var(--flame);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.user-avatar--img {
  object-fit: cover;
}

@media (max-width: 768px) {
  .auth-page {
    min-height: auto;
    padding: 1.25rem 0 2.5rem;
  }

  .auth-layout--manage {
    grid-template-columns: 1fr;
  }

  .auth-sidebar {
    position: static;
  }

  .auth-sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .auth-card__body {
    padding: 1.35rem 1.15rem 1.5rem;
  }

  .profile-form__avatar {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-form__row {
    grid-template-columns: 1fr;
  }
}
