/* Startup-style sign-in / register */

body:has(.auth-shell) {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: var(--bg);
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

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

.auth-brand-panel {
  display: none;
  position: relative;
  padding: 48px 56px;
  color: #f8fafc;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(99, 102, 241, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(37, 99, 235, 0.35), transparent 50%),
    linear-gradient(145deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
  overflow: hidden;
}

@media (min-width: 900px) {
  .auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 26rem;
}

.auth-brand-wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-decoration: none;
}

.auth-brand-tagline {
  margin: 20px 0 0;
  font-size: 1.65rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-brand-copy {
  margin: 16px 0 0;
  font-size: 0.967rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.72);
}

.auth-brand-list {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.933rem;
  color: rgba(248, 250, 252, 0.85);
}

.auth-brand-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-brand-list li::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: #818cf8;
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.45);
}

.auth-form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
  overflow: hidden;
}

.auth-form-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

/* Voice orb placement — login (same orb as Talk with your AI agent) */
.voice-orb-wrap--auth-brand {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: min(220px, 38vw);
  height: min(220px, 38vw);
  top: 50%;
  right: -4%;
  translate: 0 -42%;
}

.voice-orb-wrap--auth-mobile {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 140px;
  height: 140px;
  top: -28px;
  left: 50%;
  translate: -50% 0;
  opacity: 0.85;
}

@media (min-width: 900px) {
  .voice-orb-wrap--auth-mobile {
    display: none;
  }
}

.auth-form-mobile-brand {
  margin-bottom: 28px;
}

@media (min-width: 900px) {
  .auth-form-mobile-brand {
    display: none;
  }
}

.auth-form-mobile-brand .brand-wordmark {
  font-size: 1.2rem;
}

.auth-form-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-form-lead {
  margin: 0 0 28px;
  font-size: 0.933rem;
  color: var(--muted);
  line-height: 1.5;
}

.auth-oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.933rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-google:hover {
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn-google--muted {
  opacity: 0.92;
}

.btn-google svg {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Floating labels — login / register */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-form .form-field-float,
.auth-form .form-field-placeholder {
  position: relative;
  margin-bottom: 18px;
}

.auth-form-card .auth-form .form-field-placeholder input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  border-radius: 12px;
  min-height: 64px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  line-height: 1.35;
}

.auth-form .form-field-placeholder input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.auth-form .form-field-float:last-of-type {
  margin-bottom: 0;
}

.auth-form .form-field-float + .form-field-hint {
  margin-top: -6px;
  margin-bottom: 14px;
}

/* Beat global input { padding: 8px } in app.css (higher specificity) */
.auth-form-card .auth-form .form-field-float input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  border-radius: 12px;
  min-height: 64px;
  padding: 2rem 1rem 0.875rem;
  font-size: 1rem;
  line-height: 1.35;
}

.auth-form .form-field-float input::placeholder {
  color: transparent;
}

@keyframes auth-autofill-start {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

.auth-form .form-field-float label {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: 0.5rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
  pointer-events: none;
  transform: none;
  transition:
    top 0.15s ease,
    font-size 0.15s ease,
    color 0.15s ease,
    font-weight 0.15s ease;
}

/* Floated: focus, value, or browser autofill */
.auth-form .form-field-float:focus-within label,
.auth-form .form-field-float.is-filled label,
.auth-form .form-field-float:has(input:-webkit-autofill) label {
  top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transform: none;
}

.auth-form .form-field-float:focus-within label {
  color: var(--accent);
}

.auth-form .form-field-float.is-filled:not(:focus-within) label,
.auth-form .form-field-float:has(input:-webkit-autofill):not(:focus-within) label {
  color: var(--text-secondary);
}

/* Empty + unfocused: label in the middle of the field */
.auth-form .form-field-float.is-empty:not(:focus-within):not(:has(input:-webkit-autofill)) label {
  top: 50%;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  transform: translateY(-50%);
}

.auth-form .form-field-float input:-webkit-autofill,
.auth-form .form-field-float input:-webkit-autofill:hover,
.auth-form .form-field-float input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  animation: auth-autofill-start 0.001s;
  transition: background-color 5000s ease-in-out 0s;
}

.auth-form .form-field-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.auth-form .btn-primary.btn-block {
  margin-top: 24px;
  padding: 14px 18px;
  min-height: 52px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
}

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

.auth-switch a {
  font-weight: 500;
}

.auth-form-card .error {
  margin-bottom: 20px;
}

/* Stepped login — email first, then password */
.auth-form--stepped > .form-field-float {
  margin-bottom: 0;
}

.auth-form-step[hidden],
.auth-form-continue[hidden] {
  display: none;
}

.auth-form-continue {
  margin-top: 24px;
}

.auth-form-step .form-field-float {
  margin-bottom: 0;
}

.auth-form-step .btn-primary.btn-block {
  margin-top: 18px;
}
