/* ============================================================
   ZeroExfil portal - shared auth surface design
   Loaded AFTER style.css; intentionally overrides body / .auth-*
   ============================================================ */

/* Local tokens (extend style.css) */
:root {
  --auth-ink: #0f172a;
  --auth-ink-soft: #1e293b;
  --auth-ink-line: #d8dde5;
  --auth-bg: #fafafa;
  --auth-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Reset the dashboard body lock for auth pages */
html, body {
  position: static !important;
  overflow: auto !important;
  height: auto !important;
  min-height: 100%;
}

body {
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Brand strip (small, top-left) ---------- */
.auth-brand {
  position: absolute;
  top: 1.75rem;
  left: 2rem;
  z-index: 2;
}

.auth-brand img {
  height: 24px;
  width: auto;
  display: block;
}

/* ---------- Layout ---------- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-bg);
  padding: 4rem 1.5rem 3rem;
  box-sizing: border-box;
}

.auth-box {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: 400px;
}

/* The logo INSIDE auth-box is removed by markup updates; if any page still has
   a .logo-header child, hide it so the dominant element stays the H1. */
.auth-box .logo-header { display: none; }

/* ---------- Headline + lede ---------- */
.auth-box h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--auth-ink);
}

.auth-box p.subtitle {
  margin: 0 0 2rem 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* When no subtitle is present, the form still needs space below the H1 */
.auth-box h1 + form,
.auth-box h1 + .error-msg,
.auth-box h1 + .success-msg {
  margin-top: 1.75rem;
}

/* ---------- Form fields ---------- */
.auth-box .form-group {
  margin-bottom: 1.125rem;
}

.auth-box .form-group label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--auth-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
}

.auth-box .form-group input,
.auth-box .form-group select,
.auth-box .form-group textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  background: #fff;
  border: 1px solid var(--auth-ink-line);
  border-radius: 6px;
  color: var(--auth-ink);
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 160ms var(--auth-ease-out),
              box-shadow 160ms var(--auth-ease-out);
}

.auth-box .form-group input::placeholder,
.auth-box .form-group textarea::placeholder {
  color: #94a3b8;
}

.auth-box .form-group input:hover,
.auth-box .form-group select:hover {
  border-color: #b6bdc7;
}

.auth-box .form-group input:focus,
.auth-box .form-group select:focus,
.auth-box .form-group textarea:focus {
  outline: none;
  border-color: var(--auth-ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.auth-box .form-group small,
.auth-box .form-group .hint {
  display: block;
  margin-top: 0.4rem;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

/* Two-up row inside the form (first name / last name) */
.auth-box .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 480px) {
  .auth-box .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Primary CTA ---------- */
.auth-box .form-actions {
  margin-top: 1.5rem;
}

.auth-box .form-actions .btn,
.auth-box .form-actions button[type="submit"] {
  width: 100%;
  display: inline-block;
  padding: 0.8125rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0;
  transition: background-color 180ms var(--auth-ease-out),
              transform 140ms var(--auth-ease-out),
              box-shadow 180ms var(--auth-ease-out);
  will-change: transform;
}

.auth-box .form-actions .btn:hover:not(:disabled),
.auth-box .form-actions button[type="submit"]:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 14px rgba(193, 18, 31, 0.22);
}

.auth-box .form-actions .btn:active:not(:disabled),
.auth-box .form-actions button[type="submit"]:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow: 0 1px 4px rgba(193, 18, 31, 0.18);
}

.auth-box .form-actions .btn:focus-visible,
.auth-box .form-actions button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12), 0 4px 14px rgba(193, 18, 31, 0.22);
}

.auth-box .form-actions .btn:disabled,
.auth-box .form-actions button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Secondary text links ---------- */
.auth-box .auth-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.auth-box .auth-links a {
  color: var(--auth-ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--auth-ink-line);
  padding-bottom: 1px;
  transition: border-color 160ms var(--auth-ease-out),
              color 160ms var(--auth-ease-out);
}

.auth-box .auth-links a:hover {
  color: #000;
  border-bottom-color: var(--auth-ink);
  text-decoration: none;
}

/* Inline legal links inside a checkbox label, agreement copy, etc. */
.auth-box .agreement-text a,
.auth-box .legal-link {
  color: var(--auth-ink);
  text-decoration: underline;
  text-decoration-color: var(--auth-ink-line);
  text-underline-offset: 2px;
  font-weight: 500;
}

.auth-box .agreement-text a:hover,
.auth-box .legal-link:hover {
  text-decoration-color: var(--auth-ink);
}

/* ---------- Status messages ---------- */
.auth-box .error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.auth-box .success-msg {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ---------- Checkboxes inside the form ---------- */
.auth-box .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--auth-ink);
}

.auth-box .checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* ---------- Multi-step indicators (existing markup) ---------- */
/* If a page uses an inline step indicator, demote red to ink so red stays the
   CTA color. The indicator just shows progress; it doesn't compete. */
.auth-box .step-indicator-circle,
.auth-box [class*="step"][class*="-circle"] {
  background: #fff;
  border-color: var(--auth-ink-line);
  color: var(--color-muted);
}

.auth-box .step-indicator-item.active .step-indicator-circle,
.auth-box .step-indicator-item.current .step-indicator-circle {
  background: var(--auth-ink);
  border-color: var(--auth-ink);
  color: #fff;
}

.auth-box .step-indicator-item.completed .step-indicator-circle {
  background: #fff;
  border-color: var(--auth-ink);
  color: var(--auth-ink);
}

/* ---------- Small-screen breathing ---------- */
@media (max-width: 480px) {
  .auth-brand {
    position: static;
    text-align: center;
    padding: 1.5rem 0 0;
  }
  .auth-container {
    padding: 1.5rem 1.25rem 2.5rem;
    align-items: flex-start;
  }
  .auth-box h1 {
    font-size: 1.5rem;
  }
}

/* Reduce motion: honor user preference */
@media (prefers-reduced-motion: reduce) {
  .auth-box .form-actions .btn,
  .auth-box .form-actions button[type="submit"],
  .auth-box .form-group input,
  .auth-box .form-group select,
  .auth-box .form-group textarea,
  .auth-box .auth-links a {
    transition: none;
  }
}
