/* ========================================
   Authentication screens (login / register)
   Values taken from the Lovable /auth design; Tailwind classes are
   noted where a number would otherwise look arbitrary.
   ======================================== */

/* Everything inherits from body. This has to be declared, not just loaded:
   moved.css pins the system stack on `body, button, input, select, textarea`,
   and .modern-type alone does not undo that. Form controls are covered by the
   `font-family: inherit` rules further down, since that rule names them
   directly and body-level inheritance would not reach them. */
body.auth-page {
  font-family: 'Montserrat', sans-serif;
}

body.auth-page {
  background: #ffffff;
}

body.auth-page .main-content {
  margin: 0;
  padding: 0;
  max-width: none;
  width: 100%;
}

.auth-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* lucide renders inline <svg>; size comes from the parent rule, never a font-size */
.auth-screen svg {
  stroke-width: 2;
  flex: none;
}

/* ---------- card layout (password reset) ---------- */

.auth-card-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 24px;
  /* purple-50 -> orange-50 */
  background: linear-gradient(to bottom right, #faf5ff, #fff7ed);
}

.auth-card {
  width: 100%;
  max-width: 448px;              /* max-w-md */
  padding: 32px;                 /* p-8 */
  background: #ffffff;
  border-radius: 16px;           /* rounded-2xl */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.auth-card-heading {
  margin: 0 0 8px;
  font-size: 24px;               /* text-2xl */
  line-height: 32px;
  font-weight: 700;
  color: #111827;
}

.auth-card-subheading {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;
}

.auth-card-subheading + .auth-form,
.auth-card-heading + .auth-form,
.auth-card-subheading + .auth-done,
.auth-card-heading + .auth-done {
  margin-top: 24px;
}

/* the "Back to sign in" button on the confirmation step */
a.auth-submit--link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

/* ---------- left column: the form ---------- */

/* flex-1 in the design is `flex: 1 1 0%`, not 50% — columns take their content
   width first (min-width: auto) and split only the surplus, so the wider padding
   on this side makes it ~51/49 rather than a clean half. */
.auth-form-col {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 32px;            /* px-8 */
  background: #ffffff;
}

@media (min-width: 1024px) {
  .auth-form-col { padding: 48px 64px; }   /* lg:px-16 */
}

.auth-form-inner {
  width: 100%;
  max-width: 448px;              /* max-w-md */
  margin: 0 auto;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;           /* mb-8 */
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;                /* gray-600 */
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-back:hover { color: #111827; }
.auth-back svg { width: 16px; height: 16px; }

.auth-logo {
  height: 32px;                  /* h-8 */
  width: auto;
}

/* ---------- tabs ---------- */

.auth-tabs {
  display: flex;
  padding: 4px;
  margin-bottom: 32px;
  background: #f3f4f6;           /* gray-100 */
  border-radius: 12px;           /* rounded-xl */
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #4b5563;                /* gray-600 */
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tab:hover { color: #111827; }

.auth-tab.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);   /* shadow-sm */
}

/* ---------- headings ---------- */

.auth-heading {
  margin: 0 0 8px;
  font-size: 30px;               /* text-3xl */
  line-height: 36px;
  font-weight: 700;
  color: #111827;
}

.auth-subheading {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;
}

.auth-subheading + .auth-form {
  margin-top: 24px;              /* space-y-6 */
}

/* ---------- form ---------- */

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

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

.auth-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #374151;                /* gray-700 */
}

.auth-input {
  position: relative;
  display: block;
}

.auth-input input {
  width: 100%;
  height: 48px;                  /* h-12 */
  padding: 0 12px 0 40px;
  font-size: 14px;
  line-height: 20px;
  font-family: inherit;
  color: #25153c;
  background: #ffffff;
  border: 1px solid #e6dbf0;
  border-radius: 12px;           /* rounded-xl */
  box-shadow: none;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* only the password field carries a trailing icon */
.auth-input:has(.auth-input-suffix) input {
  padding-right: 40px;
}

.auth-input input::placeholder { color: #6c5393; }

.auth-input input:focus {
  border-color: #e6dbf0;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #7e60f6;
}

.auth-input-icon,
.auth-input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}

.auth-input-icon { left: 12px; }

.auth-input-suffix {
  right: 12px;
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.15s ease;
}

.auth-input-suffix:hover { color: #4b5563; }

.auth-input-icon svg,
.auth-input-suffix svg { width: 20px; height: 20px; }

/* two fields side by side (first / last name) */
.auth-field-row {
  display: flex;
  gap: 16px;
}

.auth-field-row .auth-field { flex: 1 1 0%; min-width: 0; }

@media (max-width: 520px) {
  .auth-field-row { flex-direction: column; gap: 20px; }
}

/* ---------- password strength meter ---------- */

.pw-meter {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pw-meter.is-visible { display: flex; }

.pw-meter-bars { display: flex; gap: 4px; }

.pw-meter-bar {
  flex: 1;
  height: 6px;
  border-radius: 9999px;
  background: #e5e7eb;
  transition: background 0.2s ease;
}

/* segment colour follows the score, matching the design's five steps */
.pw-meter[data-level="0"] .pw-meter-bar.is-filled { background: #ef4444; }   /* red-500 */
.pw-meter[data-level="1"] .pw-meter-bar.is-filled { background: #f97316; }   /* orange-500 */
.pw-meter[data-level="2"] .pw-meter-bar.is-filled { background: #eab308; }   /* yellow-500 */
.pw-meter[data-level="3"] .pw-meter-bar.is-filled { background: #84cc16; }   /* lime-500 */
.pw-meter[data-level="4"] .pw-meter-bar.is-filled { background: #22c55e; }   /* green-500 */

.pw-meter-caption {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #4b5563;
}

.pw-meter-label { font-weight: 500; }

.pw-meter-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
}

/* --rule-icon has to live on the <li>, not on ::before: a custom property set
   inside the pseudo-element cannot be overridden from the element's own rule. */
.pw-meter-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  /* lucide x */
  --rule-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.pw-meter-rules li.is-met {
  color: #16a34a;                /* green-600 */
  /* lucide check */
  --rule-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.pw-meter-rules li::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--rule-icon) center / contain no-repeat;
  mask: var(--rule-icon) center / contain no-repeat;
}

/* ---------- terms consent ---------- */

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: #4b5563;
  cursor: pointer;
}

.auth-terms input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  border-radius: 2px;
  accent-color: #7e60f6;
  cursor: pointer;
}

/* ---------- account created ---------- */

.auth-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  text-align: center;
}

.auth-done-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;           /* green-100 */
  color: #16a34a;                /* green-600 */
}

.auth-done-icon svg { width: 28px; height: 28px; }

.auth-done-text {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;
}

.auth-done-text strong { color: #111827; font-weight: 600; }

.auth-secondary {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #9333ea;
  text-decoration: none;
}

.auth-secondary:hover { text-decoration: underline; }

/* ---------- remember me / forgot ---------- */

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

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: #4b5563;
  cursor: pointer;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 2px;
  accent-color: #7e60f6;
  cursor: pointer;
}

.auth-link {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #9333ea;                /* purple-600 */
  text-decoration: none;
}

.auth-link:hover { color: #7e22ce; text-decoration: none; }

/* ---------- submit ---------- */

/* the selector needs `button` — moved.css targets button:not(.menu-toggle) */
button.auth-submit,
a.auth-submit {
  height: 48px;                  /* h-12 */
  border: none;
  border-radius: 12px;           /* rounded-xl */
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  font-family: inherit;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(to right, #9333ea 0%, #f97316 100%);
  box-shadow: none;
  transition: background 0.15s ease, transform 0.06s ease;
}

button.auth-submit:hover,
a.auth-submit:hover {
  background: linear-gradient(to right, #7e22ce 0%, #ea580c 100%);
}

button.auth-submit:active { transform: translateY(1px); }

.auth-submit:focus-visible,
.auth-tab:focus-visible,
.auth-link:focus-visible,
.auth-back:focus-visible {
  outline: 2px solid #7e60f6;
  outline-offset: 2px;
}

/* ---------- flash messages ---------- */

/* Own class rather than the shared .alert/.error, which combined.css and
   extra.css style with !important. Styled after the design's toast in the
   destructive variant: solid fill, white text, 12px radius. */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #ffffff;
  background: #6b7280;           /* neutral fallback for info/warning */
  /* lucide alert-circle. Set here, not on ::before, so variants can override it. */
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

.auth-alert::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background-color: currentColor;
  -webkit-mask: var(--alert-icon) center / contain no-repeat;
  mask: var(--alert-icon) center / contain no-repeat;
}

.auth-alert--error {
  background: #ef4444;           /* --destructive */
}

.auth-alert--success {
  background: #16a34a;           /* green-600 */
  /* lucide check-circle */
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

.auth-alert--warning { background: #d97706; }   /* amber-600 */
.auth-alert--info    { background: #7c3aed; }

/* ---------- right column: gradient panel ---------- */

.auth-panel {
  flex: 1 1 0%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px;                 /* p-12 */
  /* purple-600 -> purple-700 -> orange-500 */
  background: linear-gradient(to bottom right, #9333ea 0%, #7e22ce 50%, #f97316 100%);
}

/* space-y-8 in the design. Built with gap rather than margins because react.css
   sets `p { margin: 0 !important }` and moved.css has its own paragraph margins —
   gap sidesteps both instead of out-shouting them. */
.auth-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 448px;
  color: #ffffff;
}

.auth-panel-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;                     /* mb-4 on the heading */
}

.auth-panel-title {
  margin: 0;
  font-size: 30px;               /* text-3xl */
  line-height: 36px;
  font-weight: 700;
}

.auth-panel-subtitle {
  margin: 0;
  font-size: 18px;               /* text-lg */
  line-height: 28px;
  color: #f3e8ff;                /* purple-100 */
}

.auth-panel-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-panel-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;           /* rounded-xl */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.auth-panel-feature:hover,
.auth-panel-quote:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* cards fade in from below, staggered - mirrors SoftCardReveal in the design */
.auth-reveal {
  opacity: 0;
  animation: auth-reveal-in 0.4s ease-out forwards;
  animation-delay: var(--reveal-delay, 0s);
}

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

.auth-panel-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;            /* rounded-lg */
  background: rgba(255, 255, 255, 0.2);
}

.auth-panel-icon svg { width: 20px; height: 20px; }

.auth-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-panel-copy strong {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.auth-panel-copy span {
  font-size: 14px;
  line-height: 20px;
  color: #f3e8ff;
}

/* ---------- customer quote ---------- */

.auth-panel-quote {
  margin: 0;                     /* spacing comes from .auth-panel-inner gap */
  padding: 24px;                 /* p-6 */
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.auth-panel-quote blockquote {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-style: italic;
  color: #f3e8ff;
}

.auth-panel-quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.auth-panel-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.auth-panel-avatar svg { width: 20px; height: 20px; }

.auth-panel-person {
  display: flex;
  flex-direction: column;
}

.auth-panel-person strong {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.auth-panel-person span {
  font-size: 12px;
  line-height: 16px;
  color: #e9d5ff;                /* purple-200 */
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .auth-panel { display: none; }         /* hidden lg:flex */
  .auth-form-col { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-tab,
  .auth-back,
  .auth-submit,
  .auth-input input,
  .auth-input-suffix,
  .auth-panel-feature,
  .auth-panel-quote {
    transition: none;
  }

  .auth-reveal {
    opacity: 1;
    animation: none;
  }
}
