/* ==========================================================================
   GATE PASS — Auth screens
   Login, sign-up, onboarding — premium security platform feel.
   Two-panel: dark navy hero with owl + light card.
   ========================================================================== */

.auth {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--surface-page);
}

/* Left panel: navy hero with owl (hidden on mobile) */
.auth__hero {
  flex: 1;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(200,157,61,0.15), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(58,72,104,0.4), transparent 60%),
    var(--color-primary-900);
  color: white;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

/* Owl artwork (uses the high-detail 880KB asset) */
.auth__hero-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.07;
  pointer-events: none;
}
.auth__hero-art img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.auth__hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: var(--weight-bold);
  color: white;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
  text-decoration: none;
}
.auth__hero-brand:hover { text-decoration: none; }
.auth__hero-brand .brand-mark {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-500);
  color: var(--color-primary-900);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(200,157,61,0.3);
}
.auth__hero-brand .brand-mark svg { width: 24px; height: 24px; }

.auth__hero-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.auth__hero-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  margin-bottom: 16px;
}
.auth__hero-headline {
  font-size: 36px;
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: white;
}
.auth__hero-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  max-width: 38ch;
}

.auth__hero-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth__hero-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}
.auth__hero-feature svg {
  width: 16px; height: 16px;
  color: var(--color-accent-400);
  flex-shrink: 0;
}

/* Right panel: card */
.auth__panel {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--surface-raised);
  border-left: 1px solid var(--surface-border);
}

.auth__card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mobile brand mark — only shown when hero is hidden */
.auth__mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: var(--weight-bold);
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.auth__mobile-brand .brand-mark {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-800);
  color: var(--color-accent-500);
  border-radius: var(--radius-md);
}
.auth__mobile-brand .brand-mark svg { width: 22px; height: 22px; }

/* Headings */
.auth__title {
  font-size: 24px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}
.auth__subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Form fields */
.field__input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: 14px;
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}
.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

/* Error */
.auth__error {
  padding: 12px 14px;
  font-size: 13px;
  color: #b91c1c;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.auth__error svg { flex-shrink: 0; margin-top: 1px; color: var(--color-danger); }

/* Submit — navy primary */
.auth__submit {
  height: 42px;
  padding: 0 16px;
  width: 100%;
  font-weight: var(--weight-semibold);
  font-size: 14px;
  color: white;
  background: var(--brand);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(24,36,66,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background var(--duration-fast), box-shadow var(--duration-fast), opacity var(--duration-fast);
}
.auth__submit:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: 0 2px 6px rgba(24,36,66,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.auth__submit:disabled { opacity: 0.5; cursor: progress; }

/* OAuth button */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-weight: var(--weight-medium);
  font-size: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-raised);
  color: var(--text-primary);
  transition: all var(--duration-fast);
}
.btn-oauth:hover {
  background: var(--surface-sunken);
  border-color: var(--surface-border-strong);
}

/* Divider */
.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

/* Switch link */
.auth__switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding-top: 8px;
  border-top: 1px solid var(--surface-border);
}
.auth__link {
  color: var(--brand);
  font-weight: var(--weight-semibold);
  background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast);
}
.auth__link:hover { border-color: var(--brand); }

.field__hint { font-size: var(--text-2xs); color: var(--text-muted); }

/* Responsive: hide hero on tablet/mobile */
@media (max-width: 1023px) {
  .auth__hero { display: none; }
  /* Ensure the auth wrapper itself fills viewport so vertical centering works
     when #auth-root has no explicit height. */
  .auth { min-height: 100dvh; }
  .auth__panel {
    flex: 1;
    border-left: none;
    padding: 32px 20px;
    padding-top: max(32px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    background: var(--surface-page);
    min-height: 100dvh;
  }
  .auth__card {
    background: var(--surface-raised);
    padding: 32px 24px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
  }
  .auth__mobile-brand { display: flex; }
}

/* Phone size: kill iOS zoom-on-focus by ensuring 16px+ inputs */
@media (max-width: 767px) {
  .auth .field__input,
  .auth__submit,
  .btn-oauth { font-size: 16px; }
  /* Buttons get a comfy 48px tap height */
  .auth__submit, .btn-oauth { height: 48px; }
  .auth .field__input { height: 46px; }
}
