/* ── Auth pages (login, signup, etc.) ── */

:root {
  --auth-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --auth-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --auth-gradient-dark: linear-gradient(180deg, rgba(15, 12, 41, 0.88) 0%, rgba(49, 46, 129, 0.82) 50%, rgba(76, 29, 149, 0.78) 100%);
}

.app-shell:not(:has(.sidebar)) .content-area:has(.auth-page) {
  padding: 0;
  max-width: none;
}

.content-area:has(.auth-page) ~ .site-footer {
  display: none;
}

/* ── Full-page shell ── */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  position: relative;
  z-index: 10;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-base);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.auth-logo:hover {
  opacity: 0.85;
}

.auth-header-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.auth-header-link:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.12);
  transform: translateY(-1px);
}

.auth-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 0;
}

/* ── Brand panel ── */

.auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem;
  overflow: hidden;
  color: #fff;
}

.auth-brand-bg {
  position: absolute;
  inset: 0;
  background:
    var(--auth-gradient-dark),
    url("/static/core/images/hero/hero-01.68af6073d3dd.jpg") center center / cover no-repeat;
  z-index: 0;
}

.auth-brand-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(168, 85, 247, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 55%);
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-brand-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 1rem;
}

.auth-brand-title {
  font-family: var(--auth-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: #fff;
  text-align: left;
}

.auth-brand-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 2rem;
  text-align: left;
}

.auth-brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-brand-features li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
}

.auth-feature-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.auth-feature-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ── Form panel ── */

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.75rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(79, 70, 229, 0.08);
  padding: 2.25rem 2rem 2rem;
}

.auth-card-header {
  margin-bottom: 1.75rem;
}

.auth-card h1 {
  font-family: var(--auth-display);
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-base);
  letter-spacing: -0.03em;
  margin: 0 0 0.375rem;
  text-align: left;
}

.auth-card-subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
  text-align: left;
  line-height: 1.5;
}

/* ── Form fields ── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-base);
  text-align: left;
  margin: 0;
}

.auth-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-inline-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.auth-inline-link:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  padding: 0.8125rem 0.9375rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-base);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  margin: 0;
}

.auth-field input::placeholder {
  color: #9ca3af;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-field-error {
  font-size: 0.8125rem;
  color: #dc2626;
  margin: 0;
  font-weight: 500;
}

.auth-remember {
  margin-top: -0.25rem;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.auth-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox-mark {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.auth-checkbox input:checked + .auth-checkbox-mark {
  background: var(--primary);
  border-color: var(--primary);
}

.auth-checkbox input:checked + .auth-checkbox-mark::after {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.1rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-checkbox input:focus-visible + .auth-checkbox-mark {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ── Buttons ── */

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--auth-gradient);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.42);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-btn-secondary {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  color: var(--text-base);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.auth-btn-secondary:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

/* ── Footer links & social ── */

.auth-switch {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

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

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

.auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.auth-terms {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

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

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-social-providers {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.8125rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-base);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-sizing: border-box;
}

.auth-social-btn:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  color: var(--text-base);
}

.auth-social-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.auth-alt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

/* ── Alerts ── */

.auth-alert {
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-alert p {
  margin: 0;
  text-align: left;
}

.auth-alert--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.auth-alert--success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.auth-alert--info {
  color: #3730a3;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

/* ── Password reset flow ── */

.auth-brand-features li.is-current,
.auth-brand-features li.is-done {
  color: #fff;
}

.auth-brand-features li:not(.is-current):not(.is-done) {
  color: rgba(255, 255, 255, 0.6);
}

.auth-brand-features .auth-feature-icon {
  font-size: 0.875rem;
  font-weight: 700;
}

.auth-brand-features li.is-current .auth-feature-icon {
  background: #fff;
  border-color: #fff;
  color: var(--primary);
}

.auth-brand-features li.is-done .auth-feature-icon {
  background: var(--auth-gradient);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.auth-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: #eef2ff;
  color: var(--primary);
}

.auth-status-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.auth-status-icon--success {
  background: #ecfdf5;
  color: #059669;
}

.auth-status-icon--error {
  background: #fef2f2;
  color: #dc2626;
}

.auth-field-help {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.auth-field-help ul {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-field.has-error input {
  border-color: #fca5a5;
}

a.auth-submit {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ── Legacy wrapper (signup, password reset, Google confirm) ── */

.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 2rem 1rem;
}

.auth-wrapper .auth-card {
  margin: 0;
}

.auth-wrapper .auth-card h1 {
  text-align: center;
}

.auth-wrapper .auth-card p {
  color: var(--text-muted);
  text-align: center;
  font-size: 1rem;
}

.auth-wrapper .auth-card label {
  text-align: left;
}

.auth-wrapper .auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-wrapper .auth-card button,
.auth-wrapper .auth-card [type="submit"] {
  background: var(--auth-gradient);
  color: #fff;
  border: none;
  padding: 0.875rem 0;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 0.5rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.auth-wrapper .auth-card button:hover,
.auth-wrapper .auth-card [type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.42);
}

.auth-wrapper .extra-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.auth-wrapper .extra-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-wrapper .extra-links a:hover {
  text-decoration: underline;
}

.auth-wrapper .social-login {
  margin-top: 1.5rem;
}

.auth-wrapper .social-login > p {
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.auth-wrapper .social-providers {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.auth-wrapper .socialaccount_provider {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--text-base);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.8125rem 1rem;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-wrapper .socialaccount_provider:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  color: var(--text-base);
}

.auth-wrapper input[type="text"],
.auth-wrapper input[type="email"],
.auth-wrapper input[type="password"] {
  width: 100%;
  padding: 0.8125rem 0.9375rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  color: var(--text-base);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  margin-bottom: 0;
  font-family: inherit;
}

.auth-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#id_password_helptext {
  display: none;
}

.auth-wrapper .error,
.auth-card .error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.875rem;
}

.auth-wrapper .success {
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.auth-wrapper .info {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

/* Google sign-in confirmation page */
.google-signin-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.google-logo {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.signin-message {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
}

.google-signin-form {
  margin-bottom: 1rem;
}

.google-continue-btn {
  background: #fff;
  color: var(--text-base);
  border: 1.5px solid var(--border);
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  box-sizing: border-box;
}

.google-continue-btn:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.google-icon {
  flex-shrink: 0;
}

.justify-center {
  justify-content: center !important;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-main {
    padding: 1rem 1.25rem 2.5rem;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(79, 70, 229, 0.06);
  }
}

@media (max-width: 480px) {
  .auth-header {
    padding: 1rem 1.25rem;
  }

  .auth-header-link {
    font-size: 0.875rem;
    padding: 0.4375rem 0.75rem;
  }

  .auth-card h1 {
    font-size: 1.5rem;
  }

  .auth-name-row {
    grid-template-columns: 1fr;
    gap: 1.125rem;
  }
}
