/* ==========================================================================
   Log in / sign up pages
   Desktop and tablet: one centered card on a light grey background.
   Phones: the form full width, no card.
   ========================================================================== */

.auth {
  padding-block: var(--space-12);
  background: var(--color-panel);
}

.auth-card {
  max-width: 480px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 12px 40px rgba(16, 35, 44, 0.08);
}

/* Form side ---------------------------------------------------------------- */

.auth-main {
  padding: var(--space-10);
}

.auth-main__title {
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
}

.auth-main__lead {
  margin-top: var(--space-2);
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

/* Server-side error (wrong password etc.) */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  background: var(--color-error-soft);
  color: var(--color-error);
  font-size: 1rem;
  line-height: 1.4;
}

.auth-alert[hidden] { display: none; }
.auth-alert .icon { width: 20px; height: 20px; margin-top: 1px; }
.auth-alert:focus { outline: none; }

/* Field */
.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.field__label { font-size: 1rem; font-weight: 600; color: var(--color-text); }

.field__link { font-size: var(--fs-small); font-weight: 600; color: var(--color-pink-strong); }
.field__link:hover { text-decoration: underline; }

.field__control { position: relative; }

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 1.0625rem;      /* ≥16 px: iOS doesn't zoom in on focus */
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder { color: var(--color-text-secondary); }
.input:hover { border-color: #C9CED1; }

.input:focus {
  outline: none;
  border-color: var(--color-pink);
  box-shadow: 0 0 0 3px var(--color-pink-soft);
}

.input[aria-invalid="true"] { border-color: var(--color-error); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--color-error-soft); }

.input--password { padding-right: 56px; }

/* Show / hide password */
.field__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-secondary);
}

.field__toggle:hover { color: var(--color-text); }
.field__toggle .icon { width: 22px; height: 22px; }
.field__toggle .icon--off { display: none; }
.field__toggle[aria-pressed="true"] .icon--on { display: none; }
.field__toggle[aria-pressed="true"] .icon--off { display: block; }

.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--color-error);
}

.field__error:empty { display: none; }

.field__hint { font-size: var(--fs-small); color: var(--color-text-secondary); }
.field__hint[hidden] { display: none; }

/* Remember me */
.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.auth-form .checkbox { min-height: 44px; font-size: 1rem; color: var(--color-text); }

/* Submit */
.auth-submit {
  position: relative;
  width: 100%;
  min-height: 52px;
  font-size: 1.0625rem;
}

.auth-submit[aria-busy="true"] { color: transparent; pointer-events: none; }

.auth-submit[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin { to { rotate: 360deg; } }

/* "or" divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-block: var(--space-6);
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
}

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

/* Social sign-in: replace the text-only buttons with the official
   Google / Apple button assets from their brand kits. */
.auth-social { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }

.btn--outline {
  min-height: 48px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
}

.btn--outline:hover { border-color: var(--color-text); background: var(--color-panel); }

.auth-switch {
  margin-top: var(--space-8);
  text-align: center;
  font-size: 1.0625rem;
  color: var(--color-text);
}

.auth-switch a { font-weight: 700; color: var(--color-pink-strong); }
.auth-switch a:hover { text-decoration: underline; }

.auth-legal {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
}

.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--color-text); }

/* ---------- Phones: form only ---------- */
@media (max-width: 639px) {
  .auth { padding-block: var(--space-6) var(--space-10); background: var(--color-bg); }
  .auth-card { max-width: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .auth-main { padding: 0; }
  .auth-form { margin-top: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit[aria-busy="true"]::after { animation-duration: 2s; }
  .input { transition: none; }
}

/* Checkbox (same look as in the catalog filters) */
.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.checkbox input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-pink); cursor: pointer; }

/* Sign up: password requirements -------------------------------------------- */

.pw-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--space-4);
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
}

.pw-reqs li { display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s; }

.pw-reqs .icon {
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 50%;
  background: var(--color-panel);
  color: transparent;
  transition: background-color 0.15s, color 0.15s;
}

.pw-reqs li.is-met { color: var(--color-text); }
.pw-reqs li.is-met .icon { background: var(--color-verified); color: var(--color-text); }

/* Sign up: "check your inbox" ------------------------------------------------- */

.auth-sent { text-align: center; }
.auth-sent[hidden] { display: none; }

.auth-sent__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  background: var(--color-pink-soft);
  color: var(--color-pink-deep);
}

.auth-sent__icon .icon { width: 30px; height: 30px; }
.auth-sent .auth-main__title:focus { outline: none; }

.auth-sent__text { margin-top: var(--space-3); font-size: 1.0625rem; line-height: 1.5; color: var(--color-text); }
.auth-sent__text b { font-weight: 700; overflow-wrap: anywhere; }
.auth-sent__muted { color: var(--color-text-secondary); font-size: 1rem; }

.auth-sent__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.auth-sent__actions .btn { width: 100%; }
.auth-sent__actions .btn:disabled { opacity: 0.55; cursor: default; }

.auth-sent__link {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-pink-strong);
}

.auth-sent__link:hover { text-decoration: underline; }
.auth-sent__note { margin-top: var(--space-2); min-height: 1.4em; font-size: var(--fs-small); color: var(--color-text-secondary); }

@media (prefers-reduced-motion: reduce) {
  .pw-reqs li, .pw-reqs .icon { transition: none; }
}

/* Email confirmation result page (templates/front/registration/verify_email.html.twig) */
.auth-sent__actions > form { width: 100%; }
.auth-sent .auth-alert { margin-top: var(--space-5); text-align: left; }

/* Log in: "Send the confirmation link again" under the form (email not confirmed yet) */
.auth-resend { margin-top: var(--space-3); }
.auth-resend .btn { width: 100%; }
a.auth-sent__link { display: inline-flex; align-items: center; }
