/* Sign up / auth — SaaS-style card layout (used by signup.html) */
body.auth-body-bg {
  background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 45%, #eef2ff 100%);
  min-height: 100vh;
}

/* base.html wraps content in <main class="bg-gray-50"> — let page gradient show through */
body.auth-body-bg main:has(.auth-page) {
  background: transparent;
}

.auth-page {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding: 6.5rem 1.25rem 3rem;
  min-height: 74vh;
  box-sizing: border-box;
}

.auth-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 3rem;
  align-items: center;
}

.auth-left {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.auth-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px -16px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.auth-card__header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.headline {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.subhead {
  margin: 0;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.55;
  font-weight: 400;
}

.auth-step-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2563eb;
}

.auth-form {
  margin: 0;
}

.form-group {
  margin-bottom: 1.125rem;
}

.form-group:last-of-type {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #475569;
  margin-bottom: 0.4rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.875rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.form-input:hover {
  border-color: #cbd5e1;
}

.form-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.password-field {
  position: relative;
  display: block;
}

.form-input--with-toggle {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.password-toggle:hover {
  color: #0f172a;
  background-color: rgba(241, 245, 249, 0.9);
}

.password-toggle:focus {
  outline: none;
}

.password-toggle:focus-visible {
  color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.password-toggle__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.password-toggle__icon[hidden] {
  display: none;
}

.flash-messages {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.flash.success {
  background-color: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.flash.error {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.flash.info {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.legal {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
  margin: 1rem 0 1.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .legal {
    white-space: nowrap;
  }
}

.legal a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.legal a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-link {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.login-link a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.login-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-right {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  padding: 0;
}

.preview-card img {
  display: block;
  width: 115%;
  max-width: none;
  height: auto;
  border-radius: 16px;
  box-shadow: none;
}

/* Signup CTA — keep existing start-free-btn look, tune for card */
.signup-start-free {
  width: 100%;
  margin-top: 0.25rem;
  --h-button: 48px;
  --w-button: 200px;
  --round: 0.75rem;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
}

.signup-start-free .start-free-fold {
  height: 1rem;
  width: 1rem;
  border-bottom-left-radius: 0.5rem;
  border-top-right-radius: var(--round);
}

.signup-start-free:hover .start-free-fold {
  margin-top: -1rem;
  margin-right: -1rem;
}

.signup-start-free .start-free-points_wrapper .start-free-point {
  bottom: -10px;
  width: 2px;
  height: 2px;
}

.signup-start-free .start-free-icon {
  width: 18px;
  height: 18px;
}

.signup-start-free .start-free-inner {
  font-size: 16px;
}

@media (max-width: 1000px) {
  .auth-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .auth-left {
    grid-row: 1;
    max-width: 560px;
  }

  .auth-right {
    grid-row: 2;
  }

  .preview-card img {
    width: 100%;
    max-width: 100%;
  }

  .auth-page {
    padding-top: 5.5rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem 1.35rem;
    border-radius: 16px;
  }

  .headline {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-input,
  .signup-start-free,
  .password-toggle {
    transition: none;
  }
}

/* Email verification popup (step 2, on signup page) */
body.signup-verify-modal-open {
  overflow: hidden;
}

.signup-verify-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.signup-verify-modal[hidden] {
  display: none;
}

.signup-verify-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.signup-verify-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  margin: 0;
}

.signup-verify-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.signup-verify-modal__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.signup-verify-modal__cancel-form {
  display: none;
}

.verify-form {
  width: 100%;
}

.verify-code-label {
  text-align: center;
  margin-bottom: 0.5rem;
}

.verify-code-input {
  max-width: 16rem;
  margin: 0 auto 1.25rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.verify-submit-btn {
  width: 100%;
  max-width: 16rem;
  margin: 0 auto;
  display: block;
}

.verify-resend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #64748b;
}

.verify-resend-prompt {
  margin: 0;
}

.verify-resend-form {
  display: inline-flex;
  margin: 0;
  justify-content: center;
}

.verify-resend-link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  vertical-align: baseline;
}

.verify-resend-link:hover:not(:disabled) {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.verify-resend-link:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}
