/* ============================================================
 * Work is 1 — Auth screens (Login / Signup / Verify / Invite)
 * Layered on w1-tokens.css
 * ============================================================ */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-background);
  color: var(--fg-primary);
}

/* ----- Left: brand / illustration ----- */
.auth__brand {
  position: relative;
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 40%, #818CF8 100%);
  color: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
}
[data-theme="dark"] .auth__brand {
  background: linear-gradient(135deg, #1E1B4B 0%, #3730A3 50%, #4F46E5 100%);
}
.auth__brand-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  z-index: 2;
}
.auth__brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  display: grid; place-items: center;
  font-weight: var(--weight-bold);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth__brand-content {
  margin-top: auto;
  z-index: 2;
}
.auth__brand-eyebrow {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
}
.auth__brand-title {
  font-size: 36px;
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.auth__brand-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 420px;
  text-wrap: pretty;
}

/* Decorative — abstract geometry */
.auth__deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.auth__deco-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at top right, black 0%, transparent 70%);
}
.auth__deco-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.5;
}

.auth__features {
  margin-top: 32px;
  display: grid;
  gap: 12px;
  z-index: 2;
}
.auth__feature {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}
.auth__feature-icon {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* ----- Right: form panel ----- */
.auth__panel {
  display: flex;
  flex-direction: column;
  padding: 28px 40px;
  overflow-y: auto;
}
.auth__panel-head {
  display: flex; align-items: center; justify-content: space-between;
}
.auth__panel-lang {
  display: inline-flex;
  background: var(--chrome-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  font-size: 12px;
}
.auth__panel-lang button {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
}
.auth__panel-lang button.is-active {
  background: var(--surface-elevated);
  color: var(--fg-primary);
  box-shadow: var(--shadow-1);
}

.auth__form-wrap {
  margin: auto;
  width: 100%;
  max-width: 400px;
  padding: 40px 0;
}
.auth__title {
  font-size: 26px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.014em;
  margin-bottom: 6px;
}
.auth__sub {
  font-size: 14px;
  color: var(--fg-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ----- Form controls ----- */
.auth__field { margin-bottom: 14px; }
.auth__field-label {
  display: block;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--fg-secondary);
  margin-bottom: 6px;
}
.auth__field-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-background);
  font-size: 14px;
  color: var(--fg-primary);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.auth__field-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--alpha-primary-16);
}
.auth__field-input::placeholder { color: var(--fg-tertiary); }
.auth__field-input.is-error {
  border-color: var(--status-danger);
}
.auth__field-input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.auth__field-row {
  position: relative;
}
.auth__field-row .auth__field-input { padding-right: 44px; }
.auth__field-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
}
.auth__field-toggle:hover { background: var(--chrome-hover); color: var(--fg-primary); }

.auth__field-helper {
  font-size: 11px;
  color: var(--fg-tertiary);
  margin-top: 6px;
}
.auth__field-helper.is-error { color: var(--status-danger); }

/* Password strength */
.auth__strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.auth__strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--cool-neutral-94);
  transition: background var(--motion-fast);
}
[data-theme="dark"] .auth__strength-bar { background: var(--alpha-neutral-08); }
.auth__strength-bar.is-weak     { background: #EF4444; }
.auth__strength-bar.is-fair     { background: #F59E0B; }
.auth__strength-bar.is-good     { background: #84CC16; }
.auth__strength-bar.is-strong   { background: var(--status-success); }
.auth__strength-label {
  font-size: 11px;
  color: var(--fg-tertiary);
  margin-top: 4px;
  display: flex; justify-content: space-between;
}
.auth__strength-label span:last-child {
  font-weight: var(--weight-semibold);
}

/* Checkbox row */
.auth__check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
}
.auth__check-row.row-tight { margin-bottom: 8px; }
.auth__check-row a { color: var(--fg-link); text-decoration: underline; }
.auth__check-row a:hover { color: var(--brand-primary-hover); }

.auth__check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  display: inline-grid; place-items: center;
  background: var(--surface-background);
  flex-shrink: 0;
  margin-top: 1px;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.auth__check.is-checked {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.auth__check svg { display: none; color: white; }
.auth__check.is-checked svg { display: block; }
.auth__check-row:hover .auth__check { border-color: var(--brand-primary); }

/* Submit button */
.auth__submit {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--fg-on-primary);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  transition: background var(--motion-fast), transform var(--motion-fast);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth__submit:hover { background: var(--brand-primary-hover); }
.auth__submit:active { background: var(--brand-primary-press); }
.auth__submit:disabled { background: var(--fg-disabled); cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.auth__divider {
  display: flex; align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth__divider::before, .auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Social buttons */
.auth__social {
  display: grid;
  gap: 8px;
}
.auth__social-btn {
  height: 42px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-background);
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg-primary);
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.auth__social-btn:hover { background: var(--chrome-hover); border-color: var(--border-strong); }
.auth__social-btn svg { flex-shrink: 0; }

/* Footer (sign-up link, etc) */
.auth__footer {
  text-align: center;
  font-size: 13px;
  color: var(--fg-secondary);
  margin-top: 22px;
}
.auth__footer a, .auth__link {
  color: var(--brand-primary);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.auth__footer a:hover, .auth__link:hover { color: var(--brand-primary-hover); }
.auth__footer-link {
  text-align: right;
  font-size: 12px;
  margin-bottom: 14px;
  margin-top: -8px;
}

/* Bottom links */
.auth__panel-foot {
  margin-top: auto;
  padding-top: 20px;
  display: flex; justify-content: space-between;
  font-size: 11px;
  color: var(--fg-tertiary);
}
.auth__panel-foot a { color: var(--fg-tertiary); }
.auth__panel-foot a:hover { color: var(--fg-primary); }

/* ===== Verify-email screen ===== */
.auth__verify-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: grid; place-items: center;
  margin: 0 auto 20px;
  position: relative;
}
.auth__verify-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid var(--brand-primary-soft);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.08); }
}

.auth__verify-email {
  display: inline-block;
  padding: 4px 10px;
  background: var(--chrome-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-primary);
  margin: 0 4px;
}
.auth__verify-steps {
  list-style: none;
  padding: 24px 0 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
  display: grid;
  gap: 14px;
}
.auth__verify-step {
  display: flex; gap: 12px;
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
}
.auth__verify-step-num {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.auth__verify-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}
.auth__verify-actions > * { flex: 1; }

/* ===== Invite screen ===== */
.auth__invite-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-1);
  margin-bottom: 24px;
}
.auth__invite-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.auth__invite-ws {
  width: 48px; height: 48px;
  border-radius: 14px;
  color: white;
  font-weight: var(--weight-bold);
  font-size: 15px;
  display: grid; place-items: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.auth__invite-meta { flex: 1; min-width: 0; }
.auth__invite-name { font-size: 16px; font-weight: var(--weight-bold); letter-spacing: -0.005em; }
.auth__invite-by { font-size: 12px; color: var(--fg-tertiary); margin-top: 2px; }

.auth__invite-row {
  display: flex; justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.auth__invite-row-label { color: var(--fg-tertiary); }

.auth__invite-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-tertiary);
  margin-top: 8px;
}

/* Stepper for signup */
.auth__steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 11px;
  color: var(--fg-tertiary);
}
.auth__step-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--border-default);
}
.auth__step-dot.is-active { background: var(--brand-primary); width: 22px; border-radius: 999px; }
.auth__step-dot.is-done { background: var(--brand-primary); }

/* Top right theme + mode quick switcher (dev aid) */
.auth__top {
  position: fixed;
  top: 14px; right: 14px;
  display: flex; gap: 6px;
  z-index: 5;
}
.auth__top-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--fg-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
}
.auth__top-btn:hover { background: var(--chrome-hover); color: var(--fg-primary); }

/* Screen switcher pill — visible for demo */
.auth__demo-switcher {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-2);
  z-index: 10;
  font-size: 12px;
  gap: 2px;
}
.auth__demo-switcher button {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--fg-secondary);
  font-weight: var(--weight-medium);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.auth__demo-switcher button.is-active {
  background: var(--brand-primary);
  color: var(--fg-on-primary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand {
    padding: 28px 24px 20px;
    min-height: 200px;
    max-height: 240px;
  }
  .auth__brand-content { margin-top: 20px; }
  .auth__brand-title { font-size: 22px; margin-bottom: 8px; }
  .auth__brand-sub { font-size: 13px; }
  .auth__features { display: none; }
  .auth__panel { padding: 24px 24px 80px; }
  .auth__form-wrap { padding: 16px 0; max-width: 100%; }
  .auth__title { font-size: 22px; }
}

@media (max-width: 480px) {
  .auth__panel { padding: 20px 20px 80px; }
  .auth__title { font-size: 20px; }
  .auth__verify-icon { width: 60px; height: 60px; border-radius: 18px; }
  .auth__demo-switcher { font-size: 11px; }
  .auth__demo-switcher button { padding: 5px 10px; }
}

/* ===== Background body ===== */
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface-background);
  color: var(--fg-primary);
}
