/* ── Auth pages — Indulum ── */
/* Uses exact AppColors tokens from style.css */

body.auth-page {
  min-height: 100vh;
  background: var(--carbon);
}

/* ── Layout ── */
.auth-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}
.auth-layout-centered {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 40px 24px;
}

/* ── Brand panel (left) ── */
.auth-brand {
  background: var(--steel);
  border-right: 1px solid var(--border-dim);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--light);
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-bottom: 48px;
  display: block;
}
.auth-logo span { color: var(--copper); }
.auth-logo-centered {
  display: block;
  text-align: center;
  margin-bottom: 28px;
  font-size: 20px;
}

.auth-brand-body { flex: 1; }
.auth-brand-tagline {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--copper);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

/* Status strip */
.auth-status-strip {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  overflow: hidden;
}
.auth-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-dim);
  font-size: 12px;
}
.auth-status-row:last-child { border-bottom: none; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.run    { background: var(--signal); }
.status-dot.warn   { background: var(--warn); }
.status-dot.fault  { background: var(--fault); }
.status-dot.forced { background: var(--forced); }
.status-label { color: var(--dim); flex: 1; }
.status-value { color: var(--light); font-family: var(--font-data); font-size: 11px; }

/* Onboarding steps */
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auth-step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-dim);
  opacity: 0.4;
}
.auth-step:last-child { border-bottom: none; }
.auth-step.active { opacity: 1; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--dim);
  flex-shrink: 0;
}
.auth-step.active .step-num {
  background: var(--copper-dim);
  border-color: var(--copper-dim);
  color: var(--teal-on);
}
.step-title { font-size: 13px; color: var(--light); margin-bottom: 2px; }
.step-desc  { font-size: 12px; color: var(--dim); }

.auth-brand-copy {
  font-size: 11px;
  color: var(--dimmer);
  margin-top: 32px;
}

/* ── Right / form panel ── */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}
.auth-panel-solo {
  width: 100%;
  max-width: 460px;
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card-header {
  margin-bottom: 28px;
}
.auth-card-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--light);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.auth-card-header p {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.6;
}

/* ── Error banner ── */
.auth-error {
  display: none;
  background: rgba(229,86,78,0.1);
  border: 1px solid rgba(229,86,78,0.35);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--fault);
  margin-bottom: 16px;
  line-height: 1.5;
}
.auth-error.visible { display: block; }

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--copper);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-field-label-row label {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--copper);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field-optional {
  font-size: 10px;
  color: var(--dimmer);
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
}
.auth-field input,
.auth-field select {
  background: var(--steel);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 11px 14px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  appearance: none;
}
.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(79,179,166,0.12);
}
.auth-field input::placeholder { color: var(--dimmer); }
.auth-field input.error { border-color: var(--fault); }

/* Password input wrapper (for eye toggle) */
.auth-input-wrap { position: relative; }
.auth-input-wrap input { padding-right: 42px; }
.auth-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--dimmer);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  display: flex; align-items: center;
}
.auth-eye:hover { color: var(--copper); }

/* Password strength */
.pw-strength {
  height: 3px;
  background: var(--border-dim);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.pw-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}
.pw-strength-label {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-top: 4px;
  display: block;
}

/* Field errors */
.field-error {
  font-size: 12px;
  color: var(--fault);
  display: none;
}
.field-error.visible { display: block; }

/* Agree checkbox */
.auth-agree { display: flex; flex-direction: column; gap: 6px; }
.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
}
.auth-checkbox-label input[type="checkbox"] { display: none; }
.auth-checkbox-custom {
  width: 18px; height: 18px;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  background: var(--steel);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.auth-checkbox-label input:checked + .auth-checkbox-custom {
  background: var(--copper-dim);
  border-color: var(--copper-dim);
}
.auth-checkbox-label input:checked + .auth-checkbox-custom::after {
  content: '✓';
  color: var(--teal-on);
  font-size: 11px;
  font-weight: 700;
}

/* ── Submit button with spinner ── */
.auth-submit { position: relative; }
.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(236,230,220,0.3);
  border-top-color: var(--teal-on);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
}
.auth-submit.loading .btn-label  { opacity: 0.5; }
.auth-submit.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--dimmer);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

/* ── Google button ── */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: var(--steel);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-google:hover {
  border-color: var(--copper);
  background: var(--steel-light);
}

/* ── Footer note ── */
.auth-footer-note {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}
.auth-link {
  color: var(--copper);
  text-decoration: none;
}
.auth-link:hover { color: var(--light); }
.auth-link-small {
  font-size: 12px;
  color: var(--copper);
  text-decoration: none;
}
.auth-link-small:hover { color: var(--light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand  { display: none; }
  .auth-panel  { padding: 40px 24px; min-height: 100vh; }
  .form-row    { grid-template-columns: 1fr; }
}

/* ── Logo image in auth pages ── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--light);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
}
.auth-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.auth-logo-centered {
  justify-content: center;
  margin-bottom: 28px;
}

/* ── Apple sign-in button ──
   Matches .btn-google exactly but with Apple black styling ── */
.btn-apple {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 10px;
  text-align: center;
  line-height: 1;
}
.btn-apple:hover {
  background: #111111;
  border-color: rgba(255,255,255,0.4);
}
.btn-apple:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-apple svg {
  flex-shrink: 0;
}
