/* FitPulse — Auth pages */

html.auth-page,
body.auth-page {
  height: 100%;
  overflow: hidden;
}

.auth-layout {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  background: #042f2e;
}

.auth-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 20%, rgba(45, 212, 191, 0.22), transparent 32%),
    linear-gradient(135deg, #031a1f 0%, #053b3b 42%, #eefcf8 100%);
  z-index: 0;
}

.auth-layout::before,
.auth-layout::after {
  pointer-events: none;
}

.auth-layout .auth-bg-fit {
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg-image);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  filter: saturate(0.96) contrast(1.04);
  z-index: 1;
}

.auth-layout::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 26, 31, 0.42) 0%, rgba(4, 47, 46, 0.24) 42%, rgba(248, 250, 252, 0.18) 68%, rgba(248, 250, 252, 0.54) 100%),
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, 0.16), transparent 34%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.2), transparent 34%);
  z-index: 2;
}

/* ─── Hero panel ─── */
.auth-hero {
  position: relative;
  z-index: 3;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: #fff;
}

.auth-hero::before {
  display: none;
}

.auth-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(16px, 2.5vh, 28px) clamp(20px, 3vw, 40px) clamp(12px, 2vh, 20px);
}

.auth-hero-top {
  flex-shrink: 0;
  margin-bottom: clamp(8px, 1.5vh, 16px);
  max-width: 520px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
}

.auth-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(13, 148, 136, 0.92);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.auth-logo span { color: #5eead4; }

.auth-hero-tagline {
  margin-top: 8px;
  max-width: 460px;
  font-size: clamp(0.78rem, 1.2vw, 0.88rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.auth-hero-visual {
  flex: 1;
  display: none;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  position: relative;
  overflow: hidden;
  margin: 0 calc(-1 * clamp(20px, 3vw, 40px));
}

.auth-hero-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  max-width: none;
  flex: none;
}

.auth-hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.auth-hero-bottom {
  flex-shrink: 0;
  padding-top: 8px;
}

.auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.auth-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5eead4;
  flex-shrink: 0;
}

/* ─── Form panel ─── */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: clamp(16px, 2.5vh, 28px) clamp(20px, 3vw, 40px);
  background: transparent;
  overflow-y: auto;
  position: relative;
  z-index: 3;
}

.auth-form-box {
  width: 100%;
  max-width: 430px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 2.4vh, 26px);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(30px) saturate(1.22);
  -webkit-backdrop-filter: blur(30px) saturate(1.22);
}

.auth-form-header {
  margin-bottom: clamp(12px, 2vh, 20px);
  flex-shrink: 0;
}

.auth-form-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  color: #031a1f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.auth-form-header p {
  color: rgba(15, 23, 42, 0.82);
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-discover-cta {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.auth-discover-cta::before {
  content: "↗";
  font-size: 0.95rem;
  opacity: 0.8;
}

.auth-discover-cta:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.auth-discover-cta:focus-visible {
  outline: 3px solid rgba(251, 191, 36, 0.42);
  outline-offset: 2px;
}

.auth-form-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 14px;
  padding: clamp(14px, 1.8vh, 20px);
  box-shadow: none;
  flex-shrink: 0;
  min-height: 0;
}

.auth-login-form .form-group {
  margin-bottom: 14px;
}

.auth-login-form .form-group:last-of-type {
  margin-bottom: 12px;
}

.auth-login-form .form-label {
  font-size: 0.8rem;
  margin-bottom: 5px;
  color: rgba(15, 23, 42, 0.86);
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.45;
  pointer-events: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  color: var(--brand-hover);
}
.auth-input-icon svg { display: block; }

.auth-input-wrap .form-input {
  padding: 10px 12px 10px 38px;
  border-radius: 10px;
  border-color: rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.auth-submit {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  padding: 11px 20px !important;
  font-size: 0.875rem !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%) !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.28);
  transition: transform 0.15s, box-shadow 0.15s !important;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.36) !important;
}

.auth-footnote {
  margin-top: clamp(10px, 1.5vh, 14px);
  text-align: center;
  font-size: 0.7rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.auth-footnote strong { color: #64748b; }

.text-danger { color: #dc2626; }

/* Demo login — compact 3 kolom */
.demo-login-section { margin-bottom: 12px; }

.demo-login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-login-slug .form-label {
  font-size: 0.72rem;
  margin-bottom: 4px;
  color: rgba(15, 23, 42, 0.86);
}

.demo-login-hint {
  margin: 6px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(15, 23, 42, 0.55);
}

.demo-login-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(15, 23, 42, 0.62);
  margin-bottom: 8px;
}

.demo-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.demo-login-card { margin: 0; }

.demo-login-btn {
  width: 100%;
  text-align: center;
  padding: 7px 6px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}

.demo-login-btn:hover {
  border-color: var(--brand);
  background: rgba(240, 253, 250, 0.78);
  transform: translateY(-1px);
}

.demo-login-role {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-hover);
  line-height: 1.2;
}

.demo-login-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #071827;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-login-desc { display: none; }

.outlet-select-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outlet-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.outlet-select-card {
  width: 100%;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.outlet-select-card:hover {
  background: #ecfeff;
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.12);
  transform: translateY(-1px);
}

.outlet-select-card strong {
  display: block;
  margin-top: 3px;
  color: #0f172a;
}

.outlet-select-card small {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

.outlet-select-code {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
  text-transform: uppercase;
}

.demo-login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.demo-login-divider::before,
.demo-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f1f5f9;
}

.auth-form-card .alert {
  margin-bottom: 12px;
  padding: 10px 14px;
  font-size: 0.8rem;
}

/* Mobile */
.auth-mobile-hero { display: none; }

@media (max-width: 960px) {
  html.auth-page,
  body.auth-page {
    overflow: auto;
    height: auto;
  }

  .auth-layout {
    height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    overflow: visible;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-layout::after {
    background:
      linear-gradient(180deg, rgba(3, 26, 31, 0.72) 0%, rgba(4, 47, 46, 0.38) 26%, rgba(248, 250, 252, 0.9) 54%, rgba(248, 250, 252, 0.97) 100%);
  }

  .auth-hero { display: none; }

  .auth-mobile-hero {
    display: block;
    position: relative;
    z-index: 3;
    background: transparent;
    padding: 20px 20px 4px;
    text-align: center;
  }

  .auth-mobile-hero .auth-logo { margin-bottom: 12px; }

  .auth-mobile-hero-visual {
    display: none;
  }

  .auth-mobile-hero-visual .auth-hero-photo {
    max-height: 240px;
  }

  .auth-form-panel {
    height: auto;
    overflow: visible;
    justify-content: center;
    padding: 18px 20px 32px;
  }

  .auth-form-box {
    max-height: none;
    background: rgba(255, 255, 255, 0.18);
  }

  .demo-login-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .demo-login-grid { grid-template-columns: 1fr 1fr; }
}

/* Laptop tinggi pendek — kompres lebih lanjut */
@media (max-height: 720px) and (min-width: 961px) {
  .auth-hero-inner {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .auth-hero-tagline { display: none; }

  .auth-hero-art {
    max-height: 100%;
  }

  .auth-hero-photo {
    max-height: 100%;
  }

  .auth-form-header { margin-bottom: 10px; }

  .auth-form-header h2 { font-size: 1.3rem; }

  .auth-form-card { padding: 14px; }

  .demo-login-btn { padding: 5px 4px; }

  .demo-login-name { font-size: 0.68rem; }
}
