/* Sign-in, registration and password screens (auth layout), restyled in US-1.13 to match the marketing pages. */

/* ---------- Shell: a light panel + the form column (US-1.13) ---------- */
.auth-shell { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--white); }

.auth-brand { display: none; }

/* On phones: a light header with the logo and the way back. */
.auth-strip {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-8) var(--space-12) var(--space-8) var(--space-20);
  background: var(--white);
  border-bottom: var(--border-hairline) solid var(--line-fine);
}

.auth-strip .logo__wordmark { font-size: var(--text-3xl); letter-spacing: 0; }
.auth-strip__back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-8); font-size: var(--text-md); font-weight: 500; color: var(--text-muted); }
.auth-strip__back:hover { color: var(--ink); }

.auth-main {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(var(--space-24), 4vw, var(--space-40)) var(--space-20) var(--space-32);
  background: linear-gradient(180deg, var(--lilac-mist) 0%, var(--white) 240px);
}

.auth-main__back { display: none; }
.auth-main__back a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-base); font-weight: 500; color: var(--text-muted); }
.auth-main__back a:hover { color: var(--ink); }

.auth-main__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--space-8), 4vw, var(--space-40)) 0;
}

.auth-card { display: flex; flex-direction: column; gap: var(--space-20); width: 100%; max-width: 400px; }
.auth-help { margin: 0; text-align: center; font-size: var(--text-md); color: var(--text-muted); }

@media (min-width: 860px) {
  .auth-shell { padding: var(--space-16); gap: var(--space-16); }
  .auth-strip { display: none; }
  .auth-main { padding: var(--space-8) var(--space-32) var(--space-16); background: var(--white); }

  .auth-brand {
    position: sticky;
    top: var(--space-16);
    align-self: flex-start;
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-24);
    min-height: calc(100vh - 2 * var(--space-16));
    padding: var(--space-32) clamp(var(--space-32), 4vw, var(--space-48)) var(--space-40);
    overflow: hidden;
    background:
      radial-gradient(600px 400px at 80% 20%, var(--lilac-glow) 0%, transparent 70%),
      linear-gradient(180deg, var(--lilac-mist) 0%, var(--lilac) 100%);
    border-radius: 32px;
  }

  .auth-main__back { display: flex; justify-content: flex-end; }
}

/* The OktoKard with two small notifications. */
.auth-brand__visual { position: relative; flex: 1; display: grid; place-items: center; min-height: 320px; }
.auth-brand__card { width: min(380px, 80%); transform: rotate(-6deg); }
.auth-brand__card .member-card-wrap { max-width: none; }

.auth-toast {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-10) var(--space-14);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 30px rgb(var(--ink-rgb) / .14);
}

.auth-toast--paid { left: 4%; top: 6%; }
.auth-toast--reminder { right: 2%; bottom: 4%; }
.auth-toast__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; color: var(--warning-text); background: var(--yellow-soft); border-radius: 50%; }
.auth-toast__icon--ok { color: var(--status-paid); background: var(--success-bg); }
.auth-toast__text { display: flex; flex-direction: column; }
.auth-toast__source { font-size: var(--text-xs); color: var(--text-muted); }

.auth-facts { display: flex; flex-direction: column; gap: var(--space-14); margin: 0; padding: 0; list-style: none; }
.auth-facts__item { display: flex; align-items: center; gap: var(--space-14); }
.auth-facts__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-weight: 700; color: var(--purple-deep); background: var(--white); border-radius: var(--radius-md); }
.auth-facts__text { display: flex; flex-direction: column; color: var(--ink); }
.auth-facts__text span { font-size: var(--text-md); color: var(--text-muted); }

/* ---------- Email chosen in step one ---------- */
.auth-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-16);
  background: var(--lilac);
  border-radius: var(--radius-md);
}

.auth-email__address { min-width: 0; font-size: var(--text-lg); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.auth-email__change {
  min-height: 44px;
  padding: 0 var(--space-14);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--purple-deep);
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

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

/* ---------- Headings ---------- */
.auth-heading { display: flex; flex-direction: column; gap: var(--space-8); }
.auth-heading--wide { gap: var(--space-10); }
.auth-heading--center { gap: var(--space-10); text-align: center; }

.auth-heading__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-display-sm);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}

.auth-heading__lead { font-size: var(--text-lg); line-height: var(--leading-normal); color: var(--text-muted); }
.auth-heading__body { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--text); }
.auth-heading__note { font-size: var(--text-base); line-height: var(--leading-normal); color: var(--text-muted); }

.auth-heading__lead b,
.auth-heading__body b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.auth-icon__bg { fill: var(--purple); }

/* ---------- Form ---------- */
.auth-form { display: flex; flex-direction: column; gap: var(--space-24); }
.auth-social { display: flex; flex-direction: column; }

.password-input { position: relative; }

.password-input__toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  min-height: 40px;
  padding: 0 var(--space-12);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  transform: translateY(-50%);
  cursor: pointer;
}

.password-input__toggle:hover { color: var(--ink); background: var(--lilac); }

.auth-divider { display: flex; align-items: center; gap: var(--space-14); font-size: var(--text-md); color: var(--text-muted); }

.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-lilac); }

/* Secondary full-width buttons: Google, magic link, resend. */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-16);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  border: var(--border-control) solid var(--line-lilac);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.btn-social:hover { background: var(--hover-tint); border-color: var(--purple); box-shadow: var(--shadow-notification); }
.btn-social .icon { flex: none; color: var(--purple); }
.btn-social--purple { font-weight: 600; color: var(--purple); border-color: var(--purple); }
.btn-social--purple:hover { background: var(--lilac); }

.btn-social[disabled] {
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  border-color: var(--line-lilac);
  cursor: default;
  box-shadow: none;
}


.auth-link { display: inline-flex; align-items: center; gap: var(--space-6); align-self: flex-start; padding: var(--space-6) 0; font-size: var(--text-base); font-weight: 500; }

/* A quiet secondary option (send me a link, change the address): a button that reads as a link. */
.auth-text-button {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 44px;
  padding: 0 var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--purple-deep);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: var(--radius-xs);
}

.auth-text-button:hover { color: var(--ink); background: var(--lilac); }

/* "Besplatno zauvijek · bez kartice" and other small lines under the main button. */
.auth-note { margin: calc(-1 * var(--space-8)) 0 0; font-size: var(--text-md); color: var(--text-muted); text-align: center; }

/* A field with what belongs to it: the typo hint, the password check. */
.auth-field-group { display: flex; flex-direction: column; gap: var(--space-8); }

/* "Možda: ana@gmail.com?" under the e-mail field. */
.auth-typo { margin: 0; font-size: var(--text-md); color: var(--text); }

.auth-typo__fix {
  min-height: 32px;
  padding: 0 var(--space-2);
  font: inherit;
  font-weight: 600;
  color: var(--purple-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: 0;
}

/* "Provjeri e-mail". */
.auth-mail-icon { align-self: center; display: grid; place-items: center; width: 96px; height: 96px; margin-top: var(--space-8); color: var(--purple); background: var(--lilac); border-radius: 50%; }
.auth-actions { display: flex; flex-direction: column; gap: var(--space-12); }
.auth-actions__form { display: flex; justify-content: center; }
.auth-icon { align-self: flex-start; }

/* The primary button in the auth card lifts on hover. */
.auth-card .btn--primary:not(:disabled):hover { box-shadow: var(--shadow-featured); }

/* ---------- Password rules ---------- */
.rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  font-size: var(--text-md);
  color: var(--text);
  list-style: none;
}

.rule { display: flex; align-items: center; gap: var(--space-10); }
.rule__dot { width: 10px; height: 10px; border: 1.5px solid var(--status-inactive); border-radius: 50%; }
.rule--ok .rule__dot { background: var(--status-paid); border-color: var(--status-paid); }

/* ---------- Phone layout ---------- */

/* On phones the light header sits on top and the form fills the rest (no stretched rows). */
@media (max-width: 859px) {
  .auth-shell { flex-direction: column; flex-wrap: nowrap; }
  .auth-strip { flex: none; }
  .auth-main { flex: 1 0 auto; padding-top: var(--space-28); }
  .auth-main__center { align-items: flex-start; padding-top: 0; }
}

/* ---------- Step transition ----------
   Turbo runs visits between auth pages as a view transition (meta in the auth layout).
   The email moves from the step-one input into the step-two summary (and back on "Promijeni"),
   the card's new content fades in from slightly below, and the light panel stays put.
   Browsers without view transitions swap the page as before; reduced motion is handled in base.css. */
.auth-brand { view-transition-name: auth-brand; }
.auth-strip { view-transition-name: auth-strip; }
.auth-card { view-transition-name: auth-card; }
.auth-heading__title { view-transition-name: auth-title; }
.auth-card #email,
.auth-email { view-transition-name: auth-email; }

::view-transition-group(*) { animation-duration: .24s; animation-timing-function: ease-out; }
::view-transition-old(auth-card) { animation: .12s ease-out both auth-step-out; }
::view-transition-new(auth-card) { animation: .24s ease-out .06s both auth-step-in; }

@keyframes auth-step-out { to { opacity: 0; } }
@keyframes auth-step-in { from { opacity: 0; transform: translateY(8px); } }
