/* ShieldReplay — auth (sign in / register) */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--shell-bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(920px, 100%);
  min-height: min(580px, calc(100dvh - 40px));
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14), var(--shadow-lg);
  background: var(--surface);
}

.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 36px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse 90% 70% at 0% 0%, rgba(129, 140, 248, 0.5), transparent 50%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(56, 189, 248, 0.25), transparent 45%),
    linear-gradient(155deg, #1e1b4b 0%, #312e81 45%, #1e3a5f 100%);
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 80% at 30% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.auth-hero-inner {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
  color: inherit;
}

.auth-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-brand strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand span {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 1px;
}

.auth-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.auth-hero-lead {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.auth-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-features li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}

.auth-features li strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.auth-feature-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-feature-icon svg {
  width: 14px;
  height: 14px;
}

.auth-hero-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.auth-hero-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.auth-hero-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 36px;
  background: var(--surface);
}

.auth-panel-inner {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.auth-panel-header {
  margin-bottom: 20px;
}

.auth-panel-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--shell-text);
}

.auth-panel-header p {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}

.auth-tabs button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.auth-tabs button:hover:not(.is-active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.7);
}

.auth-tabs button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-field-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap svg.field-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.15s;
}

.auth-input-wrap input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-input-wrap input::placeholder {
  color: #94a3b8;
}

.auth-input-wrap input:hover {
  border-color: var(--line-strong);
}

.auth-input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-input-wrap:focus-within svg.field-icon {
  color: var(--accent);
}

.auth-input-wrap input[type='password'],
.auth-input-wrap input[data-password] {
  padding-right: 40px;
}

.auth-toggle-pw {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-toggle-pw:hover {
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.auth-register-fields {
  display: grid;
  gap: 14px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-top: -14px;
}

.auth-register-fields.is-visible {
  max-height: 420px;
  opacity: 1;
  margin-top: 0;
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--shell-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s, opacity 0.12s;
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.auth-submit:active:not(:disabled) {
  transform: scale(0.985);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

.auth-submit.is-loading .spinner {
  display: inline-block;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-alert.is-visible {
  display: flex;
}

.auth-alert-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: #b91c1c;
}

.auth-alert-success {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: #047857;
}

.auth-switch-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-switch-hint button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-panel-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.auth-panel-meta a {
  color: var(--muted);
  text-decoration: none;
}

.auth-panel-meta a:hover {
  color: var(--accent);
}

.auth-panel-meta .sep {
  color: var(--line-strong);
  user-select: none;
}

.auth-panel-meta code {
  font-size: 0.7rem;
  padding: 1px 5px;
}

@media (max-width: 820px) {
  .auth-page {
    align-items: flex-start;
    padding: 12px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    width: min(440px, 100%);
  }

  .auth-hero {
    padding: 24px 22px 20px;
  }

  .auth-hero h1 {
    font-size: 1.2rem;
  }

  .auth-hero-lead {
    margin-bottom: 14px;
    font-size: 0.85rem;
  }

  .auth-features {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .auth-features li {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
  }

  .auth-hero-footer {
    margin-top: 14px;
    padding-top: 12px;
  }

  .auth-panel {
    padding: 24px 22px 28px;
  }
}

@media (max-width: 420px) {
  .auth-page {
    padding: 0;
  }

  .auth-shell {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: 100dvh;
  }
}

.auth-sso { margin-bottom: 18px; }
.auth-sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-sso-btn:hover {
  border-color: var(--accent-muted);
  box-shadow: var(--shadow-sm);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
