/* auth.css — split-panel auth layout with tab switcher */

/* ── Reset for auth shell ───────────────────────────── */
.auth-shell {
  margin: 0;
  background: var(--kivo-primary);
}

/* ── Split container ────────────────────────────────── */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── Left panel ─────────────────────────────────────── */
.auth-split__left {
  background: linear-gradient(160deg, var(--kivo-primary) 0%, var(--kivo-secondary) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 3rem;
  position: relative;
  overflow: hidden;
}

.auth-split__left::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.auth-split__left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -120px;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Paw print trail ────────────────────────────────── */
.auth-paw-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Each paw-wrap handles position + static rotation.
   The svg.auth-paw inside handles opacity + scale animation only,
   keeping transforms independent so they compose correctly. */
.auth-paw-wrap {
  position: absolute;
  width: 42px;
  height: 42px;
}

/* Walking trail: bottom-right → upper-left, alternating feet
   Paw 1 = newest footstep (delay 0s), paw 7 = oldest (-6s) */
.auth-paw-wrap--1 { bottom: 10%; left: 62%; transform: rotate( 12deg); }
.auth-paw-wrap--2 { bottom: 21%; left: 36%; transform: rotate(-12deg); }
.auth-paw-wrap--3 { bottom: 32%; left: 64%; transform: rotate( 10deg); }
.auth-paw-wrap--4 { bottom: 44%; left: 33%; transform: rotate(-14deg); }
.auth-paw-wrap--5 { bottom: 56%; left: 60%; transform: rotate(  8deg); }
.auth-paw-wrap--6 { bottom: 68%; left: 30%; transform: rotate(-10deg); }
.auth-paw-wrap--7 { bottom: 80%; left: 55%; transform: rotate(  6deg); }

.auth-paw {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: footstep 7s infinite;
}

.auth-paw-wrap--1 .auth-paw { animation-delay:  0s; }
.auth-paw-wrap--2 .auth-paw { animation-delay: -1s; }
.auth-paw-wrap--3 .auth-paw { animation-delay: -2s; }
.auth-paw-wrap--4 .auth-paw { animation-delay: -3s; }
.auth-paw-wrap--5 .auth-paw { animation-delay: -4s; }
.auth-paw-wrap--6 .auth-paw { animation-delay: -5s; }
.auth-paw-wrap--7 .auth-paw { animation-delay: -6s; }

@keyframes footstep {
  0%   { opacity: 0;    transform: scale(0.55); }
  10%  { opacity: 0;    transform: scale(0.55); }
  22%  { opacity: 0.3;  transform: scale(1.08); }
  55%  { opacity: 0.22; transform: scale(1);    }
  82%  { opacity: 0.06; transform: scale(0.96); }
  100% { opacity: 0;    transform: scale(0.94); }
}

/* ── Demo CTA button ─────────────────────────────────── */
.auth-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2.25rem;
  padding: 12px 26px;
  text-decoration: none;
  position: relative;
  z-index: 1;
  width: fit-content;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
  /* 3 pulses after a short delay, then done */
  animation: demoPulse 1.3s ease 0.6s 3 both;
}

.auth-demo-btn:hover {
  background: #fff;
  border-color: #fff;
  color: var(--kivo-primary);
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

@keyframes demoPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0); }
  50%       { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.14); }
}

/* ── Brand ──────────────────────────────────────────── */
.auth-brand {
  position: relative;
  z-index: 1;
}

.auth-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.25rem;
  text-decoration: none;
}

.auth-brand__mark {
  font-family: var(--font-brand);
  font-size: 2rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 8px 18px;
  line-height: 1;
}

.auth-brand__tagline {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: #fff;
}

.auth-brand__sub {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 2.5rem;
  max-width: 30ch;
}

.auth-brand__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.auth-brand__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-brand__feature-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 0.65rem;
  flex-shrink: 0;
  color: #fff;
}

/* ── Right panel ────────────────────────────────────── */
.auth-split__right {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2.5rem;
}

.auth-right-content {
  width: 100%;
  max-width: 420px;
}

/* ── Mobile back/toggle buttons ─────────────────────── */
.auth-split__mobile-back,
.auth-split__mobile-toggle {
  display: none;
}

/* ── Flash ──────────────────────────────────────────── */
.auth-flash {
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  padding: 10px 14px;
  border: 1px solid transparent;
}

.auth-flash--notice {
  background: var(--kivo-success-soft);
  border-color: var(--kivo-success-strong);
  color: var(--kivo-success-strong);
}

.auth-flash--alert {
  background: var(--kivo-danger-soft);
  border-color: var(--kivo-danger);
  color: var(--kivo-danger);
}

/* ── Tab switcher ───────────────────────────────────── */
.auth-tabs {
  width: 100%;
}

.auth-tab-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: var(--kivo-bg);
  border: 1px solid var(--kivo-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 2rem;
}

.auth-tab-pill {
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(16, 37, 66, 0.12);
  transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.auth-tabs[data-active-tab="signup"] .auth-tab-pill {
  left: 50%;
}

.auth-tab-btn {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--kivo-text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 9px 16px;
  transition: color 0.15s ease;
  text-align: center;
}

.auth-tab-btn[data-active="true"] {
  color: var(--kivo-primary);
}

/* ── Tab panels ─────────────────────────────────────── */
.auth-panel {
  display: none;
}

.auth-panel--active {
  display: block;
}

/* ── Form headings ──────────────────────────────────── */
.auth-panel__heading {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
  color: var(--kivo-text);
}

.auth-panel__sub {
  color: var(--kivo-text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1.75rem;
}

/* ── Form fields ────────────────────────────────────── */
.auth-field {
  margin-bottom: 1rem;
}

.auth-field__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: var(--kivo-text);
  text-transform: uppercase;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  background: var(--kivo-bg);
  border: 1.5px solid var(--kivo-border);
  border-radius: 12px;
  box-sizing: border-box;
  color: var(--kivo-text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input[type="text"]:focus,
.auth-field input[type="email"]:focus,
.auth-field input[type="password"]:focus {
  background: #fff;
  border-color: var(--kivo-secondary);
  box-shadow: 0 0 0 3.5px rgba(56, 134, 151, 0.15);
  outline: none;
}

.auth-field input.field_with_errors,
.auth-field .field_with_errors input {
  border-color: var(--kivo-danger);
}

/* Devise wraps errored fields in a div.field_with_errors */
.field_with_errors {
  display: contents;
}

/* inline checkbox */
.auth-field--check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 1.25rem;
}

.auth-field--check label {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--kivo-text-muted);
  text-transform: none;
  letter-spacing: 0;
}


/* ── Submit button ──────────────────────────────────── */
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--kivo-secondary);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  min-height: 48px;
  margin-top: 1.25rem;
  padding: 12px 20px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  letter-spacing: 0.01em;
}

.auth-submit:hover {
  background: var(--kivo-primary);
  box-shadow: 0 4px 16px rgba(16, 37, 66, 0.2);
}

.auth-submit:active {
  transform: scale(0.98);
}

/* ── Form footer ────────────────────────────────────── */
.auth-panel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--kivo-border);
  font-size: 0.875rem;
  color: var(--kivo-text-muted);
}

.auth-panel__footer a {
  color: var(--kivo-secondary);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-panel__footer-sep {
  color: var(--kivo-border);
  font-size: 1rem;
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .auth-split {
    display: block;
    background: #fff;
  }

  .auth-split__left {
    display: none;
    padding: 2.5rem 1.75rem;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
  }

  .auth-split__right {
    min-height: 100vh;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }

  /* back button in left panel */
  .auth-split__mobile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.875rem;
    margin-bottom: 2.5rem;
    padding: 8px 16px;
    position: relative;
    z-index: 1;
  }

  /* kivo link in right panel */
  .auth-split__mobile-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--kivo-text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    padding: 0;
    margin-bottom: 1.75rem;
  }

  /* show-left state */
  .auth-split--show-left .auth-split__left {
    display: flex;
  }
  .auth-split--show-left .auth-split__right {
    display: none;
  }
}

.auth-split__left {
  background: linear-gradient(135deg, #7C3AED 0%, #3B82F6 60%, #10B981 100%);
  color: white;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand__tagline {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
}

.auth-brand__sub {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  margin-bottom: 24px;
}

.auth-brand__features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.auth-brand__feature {
  color: rgba(255,255,255,0.9);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.auth-brand__feature-check {
  color: #10B981;
  font-weight: 800;
  margin-right: 8px;
}

.auth-brand__mark {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.auth-demo-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border-radius: 9999px;
  padding: 12px 24px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
}

.auth-demo-btn:hover {
  background: rgba(255,255,255,0.3);
  color: white;
  text-decoration: none;
}

@media (max-width: 768px) {
  .auth-split__left {
    display: none;
  }
}
