/* Auth pages — login / signup (port of LoginSignupLayout + forms) */

:root {
  --charcoal: #2e2e2e;
  --charcoal-deep: #1a1a1a;
  --lime: #dfff5d;
  --lime-soft: #e8ff7a;
  --ink: #1a1a1a;
  --bg: #f7f7f5;
  --muted: #666666;
  --muted-soft: #888888;
  --muted-faint: #999999;
  --footer-muted: #8a8a8a;
  --border: rgba(0, 0, 0, 0.1);
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Figtree", "DM Sans", system-ui, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

.auth-shell {
  display: flex;
  min-height: 100dvh;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: var(--bg);
}

@media (min-width: 640px) {
  .auth-shell {
    align-items: center;
    padding: 1.25rem;
  }
}

.auth-card {
  display: grid;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 640px) {
  .auth-card {
    min-height: min(900px, calc(100dvh - 40px));
    max-width: 73.75rem; /* ~ max-w-295 */
    border-radius: 1rem;
    box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.08),
      0 0 0 1px rgba(0, 0, 0, 0.06);
  }
}

@media (min-width: 1024px) {
  .auth-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  }
}

/* ---------- Marketing panel ---------- */

.auth-marketing {
  position: relative;
  display: none;
  min-height: 0;
  overflow: hidden;
  background: var(--charcoal-deep);
  color: #fff;
  padding: 2.5rem;
}

@media (min-width: 1024px) {
  .auth-marketing {
    display: flex;
    flex-direction: column;
    min-height: 51.25rem;
    padding: 3rem;
  }
}

.auth-marketing-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-marketing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.auth-marketing-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.6)
  );
  pointer-events: none;
}

.auth-marketing-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100%;
  width: 100%;
  flex-direction: column;
}

.auth-marketing-top {
  margin-top: 1.5rem;
  max-width: 28rem;
}

.auth-marketing-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}

.auth-marketing-title {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--lime);
}

.auth-marketing-lede {
  margin: 1.25rem 0 0;
  max-width: 24rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.auth-marketing-foot {
  margin: auto 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Form panel ---------- */

.auth-panel {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  background: var(--bg);
  padding: 1.25rem 1.25rem 1.5rem;
}

@media (min-width: 640px) {
  .auth-panel {
    min-height: 0;
    padding: 2.5rem 2rem;
  }

  .auth-panel--compact {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .auth-panel {
    height: 100%;
    padding: 3.5rem;
  }

  .auth-panel--compact {
    padding: 2.5rem;
  }
}

@media (min-width: 1280px) {
  .auth-panel {
    padding-left: 4rem;
    padding-right: 4rem;
  }

  .auth-panel--compact {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.auth-panel-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--charcoal);
  text-decoration: none;
}

.auth-back {
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-back:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--charcoal);
}

@media (min-width: 640px) {
  .auth-back {
    padding: 0.5rem 0.75rem;
    font-size: 13px;
  }
}

.auth-panel-body {
  width: 100%;
  max-width: 28rem;
  flex: 1;
  padding: 1.5rem 0;
}

.auth-panel-body--compact {
  padding: 1.25rem 0;
}

@media (min-width: 640px) {
  .auth-panel-body {
    margin-top: auto;
    margin-bottom: auto;
    max-width: 23.75rem; /* max-w-95 */
    flex: none;
    padding: 2.5rem 0;
  }

  .auth-panel-body--compact {
    padding: 1.5rem 0;
  }
}

.auth-panel-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 0.5rem;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--footer-muted);
}

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

.auth-kicker {
  margin-bottom: 0.5rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

@media (min-width: 640px) {
  .auth-kicker {
    margin-bottom: 0.75rem;
  }
}

.auth-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6vw, 2.85rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

.auth-title--signup {
  font-size: clamp(1.75rem, 5.5vw, 2.5rem);
}

.auth-subtitle {
  margin: 0.625rem 0 0;
  max-width: 65ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

@media (min-width: 640px) {
  .auth-subtitle {
    margin-top: 0.75rem;
    font-size: 0.875rem;
  }
}

.auth-subtitle--signup {
  margin-top: 0.5rem;
  line-height: 1.5;
}

.auth-form {
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .auth-form {
    margin-top: 2rem;
  }
}

.auth-form--signup {
  margin-top: 1.25rem;
}

.auth-name-grid {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .auth-name-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.875rem;
}

@media (min-width: 640px) {
  .auth-field {
    margin-bottom: 1rem;
  }
}

.auth-field--tight {
  margin-bottom: 0.75rem;
}

.auth-label {
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--charcoal);
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 16px; /* avoids iOS zoom */
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form--signup .auth-field input {
  padding: 0.625rem 0.875rem;
}

.auth-field input::placeholder {
  color: var(--muted-faint);
}

.auth-field input:focus {
  border-color: rgba(46, 46, 46, 0.3);
  box-shadow: 0 0 0 2px rgba(46, 46, 46, 0.1);
}

@media (min-width: 640px) {
  .auth-field input[type="email"],
  .auth-field input[type="password"],
  .auth-field input[type="text"] {
    font-size: 15px;
  }

  .auth-form--signup .auth-field input {
    font-size: 14px;
  }
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 13px;
}

@media (min-width: 640px) {
  .auth-row {
    margin-bottom: 1.5rem;
  }
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  cursor: pointer;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  accent-color: var(--charcoal);
}

.auth-link {
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: #000;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 0.75rem;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
}

.auth-terms input {
  margin-top: 0.125rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border-radius: 3px;
  accent-color: var(--charcoal);
}

.auth-terms a {
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 0;
  border: 0;
  border-radius: 0.5rem;
  background: var(--lime);
  padding: 0.875rem 1.25rem;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #0f0f0f;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.auth-form--signup .auth-submit {
  margin-top: 1rem;
}

.auth-submit:hover {
  background: var(--lime-soft);
}

.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 1rem 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-faint);
}

@media (min-width: 640px) {
  .auth-form:not(.auth-form--signup) + .auth-divider {
    margin: 1.25rem 0;
  }
}

.auth-divider span:first-child,
.auth-divider span:last-child {
  height: 1px;
  flex: 1;
  background: rgba(0, 0, 0, 0.1);
}

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

.auth-switch a {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
  text-underline-offset: 2px;
  cursor: pointer;
}

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

/* ---------- Form errors (Django forms) ---------- */

.auth-form-errors {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  list-style: none;
  color: #8b1e1e;
  background: #fdecec;
  border: 1px solid rgba(139, 30, 30, 0.2);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.auth-field-error {
  display: block;
  margin-top: 0.35rem;
  color: #8b1e1e;
  font-size: 0.8125rem;
}
