/* หน้า login / register — UI ปรับปรุง */
.auth-page .app-root {
  background: transparent !important;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(165deg, #f8fafc 0%, #eef6f8 38%, #fdf2f7 100%);
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(40, 217, 206, 0.18) 0%, transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(240, 53, 122, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(40, 217, 206, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.auth-shell::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 53, 122, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: auth-float 8s ease-in-out infinite;
}

@keyframes auth-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12px, 18px); }
}

/* ── Gate card ── */
.auth-gate-card {
  max-width: 400px;
  padding: clamp(36px, 8vw, 48px) clamp(26px, 6vw, 34px) clamp(28px, 6vw, 36px);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 32px 64px rgba(18, 18, 18, 0.08),
    0 8px 24px rgba(240, 53, 122, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.auth-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #28d9ce, #f0357a);
}

.auth-gate-brand {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: none;
  position: relative;
}

.auth-gate-brand::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 20px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #28d9ce, #f0357a);
  opacity: 0.85;
}

.auth-gate-brand .brand-logo-img.brand-cart-mark--gate,
.auth-gate-brand .brand-cart-mark--gate {
  filter: drop-shadow(0 8px 20px rgba(240, 53, 122, 0.18));
}

.auth-gate-title {
  margin: 16px 0 6px;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 700;
  color: #121212;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.auth-gate-tagline {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
  max-width: 300px;
}

.auth-gate-actions {
  gap: 12px;
  margin-bottom: 28px;
}

.auth-btn-primary {
  min-height: 54px;
  font-size: 17px;
  letter-spacing: 0.03em;
  box-shadow:
    0 10px 28px rgba(240, 53, 122, 0.32),
    0 2px 8px rgba(40, 217, 206, 0.15);
}

.auth-btn-outline {
  min-height: 52px;
  border-width: 1.5px;
  background: rgba(255, 255, 255, 0.85);
}

.auth-gate-footer .auth-gate-utils {
  max-width: none;
  margin: 0;
}

.auth-gate-util {
  padding: 12px 10px;
  border-radius: 16px;
  background: #f8fafc;
  border-color: #e8ecf0;
  font-size: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.auth-gate-util:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: rgba(240, 53, 122, 0.25);
}

.auth-gate-util i {
  color: #28d9ce;
}

/* ── Form pages ── */
.auth-form-page {
  padding: 24px 20px max(32px, env(safe-area-inset-bottom));
  justify-content: flex-start;
  padding-top: max(24px, env(safe-area-inset-top));
}

.auth-form-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 36px) clamp(22px, 5vw, 28px) clamp(32px, 6vw, 40px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 24px 48px rgba(18, 18, 18, 0.07),
    0 4px 16px rgba(240, 53, 122, 0.05);
  box-sizing: border-box;
}

.auth-back {
  width: 42px;
  height: 42px;
  border: 1px solid #ececec;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}

.auth-back:hover {
  transform: translateX(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.auth-form-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-form-logo .brand-logo-img,
.auth-form-logo .brand-cart-mark {
  filter: drop-shadow(0 6px 14px rgba(240, 53, 122, 0.15));
}

.auth-form-head {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f2f5;
}

.auth-welcome {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 8px 0 0;
}

.auth-field {
  border-radius: 16px;
  min-height: 54px;
  border: 1.5px solid #e8ecf0;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-field:focus-within {
  border-color: rgba(40, 217, 206, 0.65);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(40, 217, 206, 0.12),
    0 4px 12px rgba(240, 53, 122, 0.06);
}

.auth-field > i.fi {
  color: #28d9ce;
  font-size: 17px;
}

.auth-field input {
  font-size: 15px;
}

.auth-field input::placeholder {
  color: #b0b8c4;
}

.auth-links {
  margin: 8px 0 24px;
  font-size: 12px;
}

.auth-links a {
  color: #6b7280;
  transition: color 0.15s;
}

.auth-submit {
  min-height: 54px;
  font-size: 17px;
  letter-spacing: 0.03em;
  border-radius: 999px;
  box-shadow:
    0 10px 28px rgba(240, 53, 122, 0.3),
    0 2px 8px rgba(40, 217, 206, 0.12);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px rgba(240, 53, 122, 0.35),
    0 4px 12px rgba(40, 217, 206, 0.15);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-alert.err {
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

@media (min-width: 480px) {
  .auth-gate {
    padding: 40px 24px;
  }
  .auth-form-page {
    justify-content: center;
    padding-top: 40px;
  }
}
