/* ============================================================
   Auth screens (login / signup) — clean split layout
   Form on the left, media panel with an overlay card on the right.
   Reuses the .cf-submit lifecycle animations from books.css.
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 980px;
  min-height: 560px;
  margin: 28px auto 0;
  background: #fffdfa;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: formIn 0.55s var(--ease) both;
}

/* ---------- Left: form pane ---------- */
.auth__pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}

.auth__box { width: 100%; max-width: 360px; }
.auth__box.is-shaking { animation: formShake 0.45s var(--ease); }

.auth__title {
  font-size: clamp(2.2rem, 4vw, 2.9rem);
  margin: 0 0 10px;
}
.auth__subtitle {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0 0 30px;
}

.auth__form { display: flex; flex-direction: column; }

/* ---------- Big, soft, placeholder-led inputs ---------- */
.auth-field { margin-bottom: 16px; }
.auth-field input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  padding: 17px 20px;
  background: #f3eee3;
  border: 1.5px solid transparent;
  border-radius: 12px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.auth-field input::placeholder { color: var(--ink-soft); opacity: 0.75; }
.auth-field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 106, 77, 0.14);
}
.auth-field.is-error input { border-color: #d08163; background: #fbeee9; }

.auth-field__error {
  max-height: 0;
  overflow: hidden;
  color: #a4543a;
  font-size: 0.82rem;
  opacity: 0;
  transition: max-height 0.25s var(--ease), opacity 0.25s var(--ease), margin 0.25s var(--ease);
}
.auth-field.is-error .auth-field__error { max-height: 40px; opacity: 1; margin: 7px 0 0 4px; }

/* ---------- Full-width dark submit ---------- */
.auth__submit {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 17px 20px;
  font-size: 1rem;
  color: #fff7ef;
  background: var(--ink);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(60, 44, 30, 0.22);
}
.auth__submit:hover { background: #2c241d; color: #fff7ef; transform: translateY(-2px); }
/* keep the success-state colour from books.css winning over the dark base */
.auth__submit.cf-submit--success { background: var(--sage); box-shadow: 0 8px 20px rgba(138, 154, 123, 0.4); }

.auth__alt {
  margin: 26px 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-align: center;
}
.auth__alt a { font-weight: 600; }

.cf-form-error {
  background: #f7e3dd;
  border: 1px solid #e6c3b8;
  color: #8c3a26;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
}

/* ---------- Right: media panel ---------- */
.auth__media {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 36px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 20%, #d7c4a4 0%, #b89a72 45%, #8a6e4c 100%);
}
.auth__media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.auth__logo {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 78%;
  max-width: 340px;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 16px 26px rgba(60, 30, 18, 0.3));
  animation: artFloat 6s ease-in-out infinite;
}
/* On the signup screen the logo sits a touch lower */
.auth--signup .auth__logo { top: 18%; }

@keyframes artFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

/* Frosted overlay card, like the reference */
.auth__media-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 26px;
  color: #fff7ef;
  background: rgba(60, 44, 30, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 247, 239, 0.22);
  border-radius: 16px;
}
.auth__media-title {
  color: #fff7ef;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 8px;
}
.auth__media-text {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  opacity: 0.92;
}

/* ---------- Responsive: stack, drop the media panel ---------- */
@media (max-width: 760px) {
  .auth {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: 0;
  }
  .auth__media { display: none; }
  .auth__pane { padding: 44px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth, .auth__logo { animation: none; }
  .auth__box.is-shaking { animation: none; }
}
