/* ==========================================================================
   33gibor — Authentication screens
   Depends on: reset.css, tokens.css
   ========================================================================== */

:root {
  --auth-surface: #0e0e15;
  --auth-surface-2: #16161f;
  --auth-input: #0a0a10;
  --auth-accent-soft: #a5b4fc;
  --auth-success: #22c55e;
  --auth-warning: #eab308;
  --auth-danger: #ef4444;
}

body.auth-body {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  min-height: 100vh;
}

/* ---------- Split layout ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Brand side ---------- */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--spacing-8);
  padding: var(--spacing-10) var(--spacing-12);
  background:
    radial-gradient(60% 50% at 30% 20%, rgba(79, 70, 229, 0.22), transparent 70%),
    radial-gradient(50% 40% at 80% 90%, rgba(79, 70, 229, 0.12), transparent 70%),
    var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}

.auth-brand-logo img { height: 40px; width: auto; }

.auth-brand-copy { max-width: 30rem; position: relative; z-index: 2; }

.auth-brand-title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-6);
}

/* Same highlight treatment as the public site's .text-pill-hl */
.auth-pill {
  display: inline-block;
  padding: 0 0.4em;
  border-radius: 0.35em;
  background: rgba(79, 70, 229, 0.18);
  border: 1px solid rgba(79, 70, 229, 0.35);
  color: #c7d2fe;
  font-weight: 700;
}

.auth-brand-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--spacing-3);
}

.auth-brand-list li {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  color: #cbd5e1;
  font-size: var(--font-size-base);
}

.auth-brand-list svg { flex-shrink: 0; color: var(--auth-accent-soft); }

.auth-brand-art {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.auth-brand-art img {
  max-height: 300px;
  width: auto;
  object-fit: contain;
  animation: auth-float 6s ease-in-out infinite;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.auth-brand-foot {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* ---------- Form side ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-10) var(--spacing-6);
}

.auth-mobile-logo { display: none; margin-bottom: var(--spacing-8); }
.auth-mobile-logo img { height: 36px; width: auto; }

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-2);
}

.auth-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-8);
}

.auth-subtitle a,
.auth-link {
  color: var(--auth-accent-soft);
  font-weight: 500;
  text-decoration: none;
}

.auth-subtitle a:hover,
.auth-link:hover { color: #fff; text-decoration: underline; }

/* Plan context banner (shown when user came from a pricing button) */
.auth-plan {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3) var(--spacing-4);
  margin-bottom: var(--spacing-6);
  border-radius: var(--radius-lg);
  background: rgba(79, 70, 229, 0.1);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: #c7d2fe;
  font-size: var(--font-size-sm);
}

.auth-plan svg { flex-shrink: 0; }
.auth-plan strong { color: #fff; }

/* ---------- Fields ---------- */
.auth-form { display: grid; gap: var(--spacing-4); }

.auth-field { display: grid; gap: 0.4rem; }

.auth-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: #e2e8f0;
}

.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--auth-input);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: var(--font-size-base);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder { color: #5b5b6b; }

.auth-input:hover { border-color: rgba(255, 255, 255, 0.25); }

.auth-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.auth-input.has-toggle { padding-right: 3rem; }

.auth-input.is-invalid { border-color: var(--auth-danger); }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25); }

.auth-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.auth-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.auth-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

.auth-error {
  color: #fca5a5;
  font-size: var(--font-size-xs);
  margin: 0;
}

/* Password strength */
.auth-strength { display: grid; gap: 0.35rem; }

.auth-strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.auth-strength-bar span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.auth-strength[data-score="1"] .auth-strength-bar span:nth-child(-n+1) { background: var(--auth-danger); }
.auth-strength[data-score="2"] .auth-strength-bar span:nth-child(-n+2) { background: var(--auth-warning); }
.auth-strength[data-score="3"] .auth-strength-bar span:nth-child(-n+3) { background: #84cc16; }
.auth-strength[data-score="4"] .auth-strength-bar span:nth-child(-n+4) { background: var(--auth-success); }

.auth-strength-label { font-size: var(--font-size-xs); color: var(--color-text-secondary); }

/* Checkbox rows */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: #cbd5e1;
  font-size: var(--font-size-sm);
  cursor: pointer;
  line-height: 1.45;
}

.auth-check input {
  appearance: none;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
  background: var(--auth-input);
  display: grid;
  place-content: center;
  cursor: pointer;
}

.auth-check input::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: #fff;
  transform: scale(0);
  transition: transform 0.12s ease;
}

.auth-check input:checked { background: var(--color-accent); border-color: var(--color-accent); }
.auth-check input:checked::after { transform: scale(1); }
.auth-check input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.auth-check a { color: var(--auth-accent-soft); }

/* ---------- Buttons ---------- */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-family-display);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  margin-top: var(--spacing-2);
}

.auth-btn:hover { background: #4338ca; box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4); color: #fff; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.auth-btn[disabled] { opacity: 0.6; cursor: wait; }

.auth-btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border-light);
  margin-top: 0;
}

.auth-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); box-shadow: none; }

.auth-text-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  text-decoration: underline;
  cursor: pointer;
}

.auth-text-btn:hover { color: #fff; }

/* ---------- Status messages ---------- */
.auth-alert {
  display: flex;
  gap: var(--spacing-3);
  align-items: flex-start;
  padding: var(--spacing-3) var(--spacing-4);
  margin-bottom: var(--spacing-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
}

.auth-alert svg { flex-shrink: 0; margin-top: 0.1rem; }

.auth-alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.auth-note {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin-bottom: var(--spacing-6);
}

.auth-footer-note {
  margin-top: var(--spacing-8);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.auth-footer-note a { color: var(--color-text-secondary); text-decoration: underline; }
.auth-footer-note a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-main { justify-content: flex-start; padding-top: var(--spacing-12); }
}

@media (max-height: 760px) and (min-width: 961px) {
  .auth-brand-art img { max-height: 200px; }
}
