/* ==========================================================================
   RESTO auth pages (login, register, forgot/reset password, verify email)
   Loaded after frontend.css, which provides the design tokens, fonts,
   buttons, brand, kicker and ticket styles.
   ========================================================================== */

.auth-body { background: var(--resto-paper); min-height: 100vh; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

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

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 1.75rem clamp(1.25rem, 5vw, 4.5rem);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--resto-muted);
  text-decoration: none;
}
.auth-back:hover { color: var(--resto-brand-700); }

.auth-form-wrap {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 3rem 0;
}
.auth-head { margin-bottom: 2rem; }
.auth-title {
  font-family: var(--resto-serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}
.auth-title em { font-style: italic; font-weight: 400; color: var(--resto-brand-700); }
.auth-sub { color: var(--resto-muted); font-size: 1.02rem; margin: 0; }

.auth-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  font-size: 1.5rem;
  color: var(--resto-brand-700);
  background: var(--resto-brand-100);
}

/* ---------- Fields ---------- */

.auth-form .field { margin-bottom: 1.15rem; }
.auth-form .form-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.auth-form .form-control,
.auth-form .input-group-text {
  min-height: 50px;
  border-color: var(--resto-border);
  border-radius: 0.85rem;
  background-color: #fff;
  font-size: 0.98rem;
}
.auth-form .form-control::placeholder { color: #b3a79e; }
.auth-form .form-control:focus {
  border-color: var(--resto-brand-700);
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.12);
}

.input-icon { position: relative; }
.input-icon > i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a3968c;
  pointer-events: none;
}
.input-icon .form-control { padding-left: 2.75rem; }
.input-icon .form-control:has(+ .toggle-password) { padding-right: 3rem; }
.input-icon:focus-within > i { color: var(--resto-brand-700); }

.toggle-password {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #a3968c;
}
.toggle-password:hover { color: var(--resto-charcoal); background: var(--resto-soft); }

.input-phone .input-group-text {
  font-weight: 600;
  color: var(--resto-muted);
  background: var(--resto-soft);
}
.input-phone .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-phone .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.form-check-input { width: 1.15em; height: 1.15em; border-color: #cdbfb4; }
.form-check-input:checked { background-color: var(--resto-brand-700); border-color: var(--resto-brand-700); }
.form-check-input:focus { border-color: var(--resto-brand-700); box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.12); }
.form-check-label { font-size: 0.93rem; color: var(--resto-muted); }

/* Invalid state (set by auth.js in the demo) */
.auth-form .is-invalid { border-color: #dc2626 !important; }
.auth-form .is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12) !important; }
.field-error { display: block; margin-top: 0.35rem; font-size: 0.84rem; color: #b91c1c; }

/* Password strength */
.strength { margin: -0.4rem 0 1.25rem; }
.strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 0.4rem; }
.strength-bar span { height: 5px; border-radius: 999px; background: var(--resto-soft-200); transition: background-color 0.2s ease; }
.strength[data-level='1'] .strength-bar span:nth-child(-n+1) { background: #dc2626; }
.strength[data-level='2'] .strength-bar span:nth-child(-n+2) { background: #f59e0b; }
.strength[data-level='3'] .strength-bar span:nth-child(-n+3) { background: #65a30d; }
.strength[data-level='4'] .strength-bar span:nth-child(-n+4) { background: #15803d; }
.strength-text { color: var(--resto-muted); }

/* ---------- Links, steps, alerts ---------- */

.auth-link { color: var(--resto-brand-700); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: #9a3412; text-decoration: underline; }

.auth-switch { margin: 1.75rem 0 0; text-align: center; color: var(--resto-muted); }

.auth-steps {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1.75rem;
}
.auth-steps li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a3968c;
}
.auth-steps li + li::before {
  content: '';
  width: 22px;
  height: 1px;
  margin-right: 0.1rem;
  background: var(--resto-border);
}
.auth-steps span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  border: 1px solid var(--resto-border);
  background: #fff;
}
.auth-steps .is-active { color: var(--resto-charcoal); }
.auth-steps .is-active span { background: var(--resto-brand-700); border-color: var(--resto-brand-700); color: #fff; }
.auth-steps .is-done { color: var(--resto-charcoal); }
.auth-steps .is-done span { background: var(--resto-brand-100); border-color: var(--resto-brand-100); color: var(--resto-brand-700); }

.auth-alert {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--resto-radius);
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #14532d;
}
.auth-alert:not(.d-none) { animation: auth-pop 0.25s ease; }
.auth-alert > i { font-size: 1.3rem; color: #15803d; }
.auth-alert strong { display: block; }
.auth-alert span { font-size: 0.92rem; }
@keyframes auth-pop { from { opacity: 0; transform: translateY(-4px); } }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  color: #a3968c;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--resto-border); }

.auth-legal { margin: 0; text-align: center; font-size: 0.82rem; color: #a3968c; }
.auth-legal a { color: inherit; }

/* ---------- Brand side ---------- */

.auth-aside {
  position: sticky;
  top: 0.75rem;
  margin: 0.75rem 0.75rem 0.75rem 0;
  height: calc(100vh - 1.5rem);
  border-radius: var(--resto-radius-lg);
  overflow: hidden;
  background: var(--resto-brand-900);
  color: rgba(255, 255, 255, 0.8);
  isolation: isolate;
}
.auth-aside-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  z-index: -2;
}
.auth-aside::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(245, 184, 65, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(36, 18, 11, 0.55), rgba(36, 18, 11, 0.95));
}
.auth-aside-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: clamp(2rem, 4vw, 3.5rem);
}
.auth-aside-title {
  font-family: var(--resto-serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.2rem + 2vw, 3.1rem);
  line-height: 1.08;
  color: #fff;
  margin-bottom: 1rem;
}
.auth-aside-title em { font-style: italic; font-weight: 400; color: var(--resto-accent); }
.auth-aside-text { max-width: 30rem; font-size: 1.05rem; margin-bottom: 2rem; }

.auth-ticket {
  position: absolute;
  top: clamp(2rem, 6vh, 4rem);
  right: clamp(2rem, 4vw, 3.5rem);
  left: auto;
  transform: rotate(3deg);
  animation: float 6s ease-in-out infinite;
}

.auth-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.93rem;
}
.auth-points i { color: var(--resto-accent); margin-right: 0.3rem; }

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-form-wrap { padding: 2.5rem 0; }
}
@media (max-width: 575.98px) {
  .auth-back span, .auth-back { font-size: 0.85rem; }
  .auth-steps li + li::before { width: 12px; }
}
@media (max-height: 760px) and (min-width: 992px) {
  .auth-ticket { display: none; }
}

/* ---------- Invitation (accept-invite page) ---------- */

.invite-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--resto-border);
  border-radius: var(--resto-radius);
  background: #fff;
}
.invite-avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--resto-brand-700);
  color: #fff;
  font-weight: 800;
}
.invite-card strong { display: block; color: var(--resto-charcoal); }
.invite-card small { color: var(--resto-muted); }

.auth-form .form-control[readonly] { background-color: var(--resto-soft); color: var(--resto-muted); }
.auth-form .form-control[readonly]:focus { border-color: var(--resto-border); box-shadow: none; }
.field-help { display: block; margin-top: 0.35rem; font-size: 0.82rem; color: var(--resto-muted); }
