/* Auth pages — isolated from landing styles */

.auth-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 56px;
  background: #f8fafc;
}

.auth-page__inner {
  width: min(100%, 400px);
  margin-inline: auto;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  width: 100%;
  justify-content: center;
  color: var(--navy, #0f1b2d);
  text-decoration: none;
}

.auth-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.auth-brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand__text {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.auth-card {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 20px;
  padding: 28px 28px 24px;
  box-shadow:
    0 1px 2px rgba(15, 27, 45, 0.03),
    0 14px 36px rgba(15, 27, 45, 0.06);
}

.auth-card > .auth-brand {
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f6;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-card__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy, #0f1b2d);
  line-height: 1.2;
}

.auth-card__subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #6b7280;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13.5px;
}

.auth-alert p {
  margin: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

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

.auth-forgot {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
}

.auth-forgot:hover {
  color: var(--navy, #0f1b2d);
  text-decoration: underline;
}

.auth-field--row {
  margin-top: -4px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy, #0f1b2d);
  cursor: pointer;
}

.auth-card--enter {
  animation: auth-card-enter 500ms ease both;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: var(--navy, #0f1b2d);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.auth-input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(15, 27, 45, 0.08);
}

.auth-field.has-error .auth-input {
  border-color: #f87171;
}

.auth-hint {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.auth-error {
  margin: 0;
  font-size: 12.5px;
  color: #dc2626;
  line-height: 1.4;
}

.auth-password {
  position: relative;
}

.auth-password .auth-input {
  padding-right: 48px;
}

.auth-password__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-password__toggle:hover {
  background: #f1f5f9;
  color: var(--navy, #0f1b2d);
}

.auth-password__toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.auth-password__toggle .auth-eye {
  display: none !important;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  pointer-events: none;
}

/* Default: password hidden → open eye (click to reveal) */
.auth-password__toggle .auth-eye--show {
  display: block !important;
}

.auth-password__toggle .auth-eye--hide {
  display: none !important;
}

/* Revealed: password visible → slashed eye (click to hide) */
.auth-password__toggle.is-visible .auth-eye--show {
  display: none !important;
}

.auth-password__toggle.is-visible .auth-eye--hide {
  display: block !important;
}

.auth-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
}

.auth-strength__bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.auth-strength__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #94a3b8;
  transition: width 0.2s ease, background 0.2s ease;
}

.auth-strength.is-weak .auth-strength__bar i {
  width: 33%;
  background: #f59e0b;
}

.auth-strength.is-medium .auth-strength__bar i {
  width: 66%;
  background: #0ea5e9;
}

.auth-strength.is-strong .auth-strength__bar i {
  width: 100%;
  background: #16a34a;
}

.auth-strength__label {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.auth-strength.is-weak .auth-strength__label { color: #d97706; }
.auth-strength.is-medium .auth-strength__label { color: #0284c7; }
.auth-strength.is-strong .auth-strength__label { color: #15803d; }

/* —— Google OAuth —— */
.auth-oauth {
  margin: 18px 0 0;
}

.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--navy, #0f1b2d);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04);
}

.auth-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  color: var(--navy, #0f1b2d);
}

.auth-google:active {
  transform: translateY(0);
  background: #f1f5f9;
}

.auth-google:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.auth-google.is-loading,
.auth-google[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.85;
  cursor: wait;
}

.auth-google__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.auth-google__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.auth-google__label {
  line-height: 1;
}

.auth-google.is-loading .auth-google__icon {
  display: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
}

.auth-divider__line {
  flex: 1;
  height: 1px;
  background: #e8ecf1;
}

.auth-divider__text {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

html[data-theme="dark"] .auth-google {
  background: #121a2a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8eef7;
}

html[data-theme="dark"] .auth-google:hover {
  background: #182234;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e8eef7;
}

html[data-theme="dark"] .auth-divider__line {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .auth-divider__text {
  color: #8b93a7;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--navy, #0f1b2d);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover {
  background: #1a2a40;
  transform: translateY(-1px);
}

.auth-submit:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.auth-switch {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

.auth-switch a {
  color: var(--navy, #0f1b2d);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-otp-timer {
  margin: 0 0 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #0f1b2d;
  font-variant-numeric: tabular-nums;
}

.auth-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}

.auth-otp__digit {
  width: 100%;
  height: 52px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0f1b2d;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-otp__digit:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35);
}

.auth-otp__digit:disabled {
  opacity: 0.6;
  background: #f8fafc;
}

.auth-otp-hint {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.auth-submit--ghost {
  background: transparent;
  color: #0f1b2d;
  border: 1px solid #d7dee8;
}

.auth-submit--ghost:hover {
  background: #f8fafc;
  transform: none;
}

.auth-submit--ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.auth-alert--ok {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.site-messages {
  width: min(100% - 40px, 1180px);
  margin: 12px auto 0;
}

.site-message {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.site-message--success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.site-message--info {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.site-message--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

@media (max-width: 480px) {
  .auth-page {
    padding: 24px 14px 40px;
  }

  .auth-page__inner {
    width: min(100%, 400px);
  }

  .auth-card {
    padding: 24px 20px 20px;
    border-radius: 18px;
  }

  .auth-card > .auth-brand {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .auth-brand__text {
    font-size: 14px;
  }

  .auth-card__title {
    font-size: 20px;
  }

  .auth-otp {
    gap: 6px;
  }

  .auth-otp__digit {
    height: 46px;
    font-size: 18px;
    border-radius: 10px;
  }

  .auth-submit,
  .auth-google {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .auth-otp {
    gap: 4px;
  }

  .auth-otp__digit {
    height: 40px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit,
  .auth-input,
  .auth-strength__bar i {
    transition: none !important;
  }

  .auth-submit:hover {
    transform: none;
  }

  .auth-card--enter {
    animation: none;
  }
}
