/* Auth pages: login, first-login, forgot-password, setup-password — PikinLab SaaS style */
:root {
  --auth-bg: #f5f7fb;
  --auth-bg-spot: rgba(124, 58, 237, 0.05);
  --auth-card-bg: #ffffff;
  --auth-card-border: rgba(0, 0, 0, 0.06);
  --auth-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
  --auth-heading: #030213;
  --auth-sub: #717182;
  --auth-input-bg: #ffffff;
  --auth-input-border: #e5e7eb;
  --auth-input-focus: #7c3aed;
  --auth-input-focus-ring: rgba(124, 58, 237, 0.2);
  --auth-placeholder: #9ca3af;
  --auth-btn-from: #7c3aed;
  --auth-btn-via: #a855f7;
  --auth-btn-to: #ea580c;
  --auth-btn-text: #ffffff;
  --auth-link: #7c3aed;
  --auth-link-hover: #6d28d9;
  --auth-error-bg: #fef2f2;
  --auth-error-border: #fecaca;
  --auth-error-text: #991b1b;
  --auth-footer: #717182;
}

@media (prefers-color-scheme: dark) {
  :root {
    --auth-bg: #1c1b1f;
    --auth-bg-spot: rgba(140, 120, 220, 0.06);
    --auth-card-bg: #252429;
    --auth-card-border: rgba(255, 255, 255, 0.08);
    --auth-card-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
    --auth-heading: #f2f1ef;
    --auth-sub: #a8a6a2;
    --auth-input-bg: #2c2b30;
    --auth-input-border: #3d3c42;
    --auth-input-focus: #9d8ef5;
    --auth-input-focus-ring: rgba(157, 142, 245, 0.3);
    --auth-placeholder: #7a7672;
    --auth-btn-from: #7c6fdc;
    --auth-btn-via: #c06d8a;
    --auth-btn-to: #d4925e;
    --auth-btn-text: #ffffff;
    --auth-link: #a89cf5;
    --auth-link-hover: #c4b8ff;
    --auth-error-bg: #3d2525;
    --auth-error-border: #5c3535;
    --auth-error-text: #fecaca;
    --auth-footer: #7a7672;
  }
}

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

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--auth-bg-spot), transparent 55%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: 16px;
  box-shadow: var(--auth-card-shadow);
  padding: 40px 36px 32px;
  animation: authCardIn 0.4s ease-out;
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  display: block;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--auth-heading);
  text-decoration: none;
  margin-bottom: 28px;
}

.auth-logo:focus-visible {
  outline: 2px solid var(--auth-input-focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.auth-logo-img {
  display: block;
  max-width: 180px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: middle;
}

.auth-heading {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--auth-heading);
  line-height: 1.3;
}

.auth-sub {
  margin: 0 0 28px;
  font-size: 0.9375rem;
  color: var(--auth-sub);
  line-height: 1.45;
}

.auth-form .auth-group {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-heading);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 1rem;
  color: var(--auth-heading);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-form input::placeholder {
  color: var(--auth-placeholder);
}

.auth-form input:hover {
  border-color: var(--auth-placeholder);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--auth-input-focus);
  box-shadow: 0 0 0 3px var(--auth-input-focus-ring);
}

.auth-form input:focus-visible {
  outline: none;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--auth-sub);
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--auth-input-focus);
  cursor: pointer;
}

.auth-remember:focus-within {
  outline: none;
}

.auth-link {
  font-size: 0.875rem;
  color: var(--auth-link);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--auth-link-hover);
}

.auth-link:focus-visible {
  outline: 2px solid var(--auth-input-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-btn {
  width: 100%;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--auth-btn-text);
  background: linear-gradient(90deg, var(--auth-btn-from) 0%, var(--auth-btn-to) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.auth-btn:active {
  transform: translateY(0);
  opacity: 0.96;
}

.auth-btn:focus-visible {
  outline: 2px solid var(--auth-input-focus);
  outline-offset: 2px;
}

.auth-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--auth-card-border);
  font-size: 0.8125rem;
  color: var(--auth-footer);
  text-align: center;
}

.auth-alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  line-height: 1.45;
  border-radius: 12px;
  border: 1px solid var(--auth-error-border);
  background: var(--auth-error-bg);
  color: var(--auth-error-text);
}

.auth-alert-success {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
}

@media (prefers-color-scheme: dark) {
  .auth-alert-success {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
  }
}

.auth-extra {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--auth-sub);
  text-align: center;
}

.auth-extra a {
  color: var(--auth-link);
  text-decoration: none;
}

.auth-extra a:hover {
  color: var(--auth-link-hover);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px 28px;
  }
  .auth-heading {
    font-size: 1.375rem;
  }
}
