/* ============================================================
   Krewly — Auth (login & register)
   Builds on style.css tokens (--navy, --blue, --spark, easings…)
   ============================================================ */

.auth-body { background: var(--white); }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
}

/* ---------- Brand panel (left) ---------- */
.auth-aside {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #24449C 0%, var(--navy) 55%, #16306E 100%);
  color: #fff;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}
.aside-bolt {
  position: absolute;
  right: -60px; top: 50%;
  width: 420px; height: 420px;
  transform: translateY(-50%) rotate(8deg);
  color: rgba(255,255,255,.05);
  pointer-events: none;
}
.aside-bolt svg { width: 100%; height: 100%; }

.auth-logo { position: relative; z-index: 1; }
.auth-logo .logo-word { color: #fff; }

.aside-content { position: relative; z-index: 1; }
.aside-content h2 { color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1.12; margin: 18px 0 22px; }
.pill-navy-on-dark { background: rgba(255,255,255,.14); color: #DBEAFE; }

.aside-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.aside-list li { display: flex; align-items: center; gap: 12px; color: #DBEAFE; font-size: 1rem; }
.aside-list .bolt { width: 18px; height: 18px; color: var(--spark); flex-shrink: 0; }

.aside-proof { color: #93C5FD; font-size: .95rem; }
.aside-proof strong { color: #fff; font-family: "Space Grotesk", sans-serif; }

/* ---------- Form panel (right) ---------- */
.auth-main { display: flex; flex-direction: column; padding: 28px 32px 40px; }
.auth-topbar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .9rem; color: var(--slate);
}
.back-link { color: var(--slate); font-weight: 500; transition: color .18s var(--ease-out); }
.back-link:hover { color: var(--navy); }
.topbar-switch a { font-weight: 600; }

.auth-card {
  width: 100%;
  max-width: 416px;
  margin: auto;
  padding: 28px 0;
}
.auth-card-logo { display: none; margin-bottom: 22px; }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-sub { color: var(--slate); margin-bottom: 26px; }

/* ---------- Segmented control ---------- */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--mist);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  isolation: isolate;
}
.seg-thumb {
  position: absolute;
  z-index: 1;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease-out);
}
.seg[data-role="organizator"] .seg-thumb { transform: translateX(100%); }
.seg-input { position: absolute; opacity: 0; pointer-events: none; }
.seg-label {
  position: relative; z-index: 2;
  text-align: center;
  padding: 10px 8px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600; font-size: .94rem;
  color: var(--slate);
  cursor: pointer;
  border-radius: 9px;
  transition: color .2s var(--ease-out);
  user-select: none;
}
.seg-input:checked + .seg-label { color: var(--navy); }
.seg-input:focus-visible + .seg-label { box-shadow: 0 0 0 3px rgba(37,99,235,.35); }

/* ---------- Form ---------- */
.auth-form { display: flex; flex-direction: column; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field label .muted { color: var(--slate); font-weight: 500; }

.input {
  width: 100%;
  padding: 12px 14px;
  font-family: "Inter", sans-serif;
  font-size: .96rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.input::placeholder { color: #94A3B8; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.input:user-invalid { border-color: #E11D48; }
.input:user-invalid:focus { box-shadow: 0 0 0 4px rgba(225,29,72,.12); }

/* password field with toggle */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: none; background: transparent;
  color: #94A3B8; cursor: pointer; border-radius: 8px;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.pass-toggle:hover { color: var(--navy); background: var(--mist); }
.pass-toggle .eye { width: 20px; height: 20px; }
.pass-toggle.is-on { color: var(--blue); }

/* checkbox */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--slate); cursor: pointer; margin: 4px 0 6px; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
.check a { font-weight: 600; }

.form-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; }
.forgot { font-size: .88rem; font-weight: 600; }

/* buttons */
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }
.btn-submit { position: relative; }
.btn-submit .spinner {
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin .6s linear infinite;
}
.btn-submit.is-loading .btn-label { opacity: 0; }
.btn-submit.is-loading .spinner { opacity: 1; }
.btn-submit.is-loading { pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-social {
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--line);
  font-family: "Inter", sans-serif; font-weight: 600;
}
.btn-social:active { transform: scale(.97); }
.g-icon { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .btn-social:hover { border-color: #CBD5E1; background: #FAFBFC; }
}

/* divider */
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #94A3B8; font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-switch { text-align: center; margin-top: 22px; color: var(--slate); font-size: .92rem; }
.auth-switch a { font-weight: 600; }

/* ---------- Success state ---------- */
.auth-success { text-align: center; padding: 16px 0; }
.success-check {
  width: 64px; height: 64px; margin: 0 auto 22px;
  border-radius: 50%; background: #DCFCE7;
  display: flex; align-items: center; justify-content: center;
}
.success-check svg { width: 32px; height: 32px; color: #16A34A; }
.success-check path {
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: draw .5s var(--ease-out) .1s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.auth-success h2 { margin-bottom: 10px; }
.auth-success p { color: var(--slate); margin-bottom: 24px; }
.auth-note { font-size: .82rem; color: #94A3B8; margin-top: 18px; }

/* ---------- Entrance ---------- */
.reveal-ready .auth-card { animation: authIn .55s var(--ease-out) both; }
.reveal-ready .auth-aside .aside-content,
.reveal-ready .auth-logo { animation: authIn .6s var(--ease-out) both; }
.reveal-ready .auth-aside .aside-content { animation-delay: .08s; }
@keyframes authIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card-logo { display: inline-flex; }
  .auth-main { padding: 22px 22px 36px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 18px 0; }
  .auth-card h1 { font-size: 1.65rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal-ready .auth-card,
  .reveal-ready .auth-aside .aside-content,
  .reveal-ready .auth-logo { animation: none; }
  .seg-thumb, .input, .back-link, .pass-toggle { transition: none; }
  .success-check path { animation: none; stroke-dashoffset: 0; }
  .btn-submit .spinner { animation-duration: .9s; }
}

/* Referral banner (registrace přes pozvánku) */
.ref-banner {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FFF1E6; border: 1px solid #FED7AA; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 18px; font-size: .88rem; color: var(--spark-deep, #EA580C);
}
.ref-banner .bolt { width: 18px; height: 18px; flex-shrink: 0; color: var(--spark, #F97316); margin-top: 1px; }
.ref-banner strong { color: var(--spark-deep, #EA580C); }
