/* =========================================================
   InstanHosting — auth.css
   Halaman login Client Area
   ========================================================= */

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

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--surface);
}

/* ---------- Panel visual (kiri) ---------- */
.auth-visual {
  position: sticky;
  top: 0;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: clamp(28px, 3.4vw, 46px) clamp(28px, 4vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(680px 420px at 88% 0%, rgba(18, 194, 233, 0.3), transparent 62%),
    radial-gradient(620px 460px at 6% 100%, rgba(42, 91, 255, 0.42), transparent 64%),
    linear-gradient(160deg, #0d1e3a 0%, #071120 58%, #040c18 100%);
  color: var(--on-dark);
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(78% 70% at 60% 20%, #000, transparent 84%);
  pointer-events: none;
}
.auth-visual > * { position: relative; z-index: 1; }

.auth-brand img.brand-mark { width: auto; height: 38px; max-width: 200px; }

.auth-visual-body {
  margin-block: auto;
  max-width: 470px;
}
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a9c6ff;
}
.auth-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #7dd3fc; }

.auth-visual-body h2 {
  color: #fff;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  max-width: 18ch;
}
.auth-visual-body > p {
  margin-top: 14px;
  max-width: 42ch;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--on-dark-dim);
}

.auth-points {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--on-dark);
}
.auth-points i {
  margin-top: 2px;
  flex: none;
  color: #6ee7d0;
  font-size: 0.95rem;
}

/* Mini dashboard preview */
.auth-mini {
  margin-top: 32px;
  padding: 14px;
  border: 1px solid rgba(140, 175, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 30, 52, 0.92), rgba(6, 15, 27, 0.94));
  box-shadow: 0 34px 60px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.auth-mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.66rem;
  color: #8ea6c4;
}
.auth-mini-head strong { color: #dce9ff; font-weight: 600; }
.auth-mini-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7ff0b4;
}
.auth-mini-pill i { font-size: 0.5rem; }

.auth-mini-rows { display: grid; gap: 8px; margin-top: 12px; }
.auth-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.68rem;
  color: #b9cbe4;
}
.auth-mini-row i { color: #7dd3fc; font-size: 0.82rem; }
.auth-mini-row span { flex: 1; }
.auth-mini-row b { font-size: 0.72rem; font-weight: 700; color: #fff; }

.auth-visual-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  color: #93aac6;
}
.auth-visual-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-visual-foot i { color: #6ee7d0; }

/* ---------- Panel form (kanan) ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 36px) clamp(20px, 4vw, 56px);
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(42, 91, 255, 0.06), transparent 70%),
    #fff;
}
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease;
}
.auth-back:hover { color: var(--brand-700); }
.auth-back i { transition: transform 0.25s var(--ease); }
.auth-back:hover i { transform: translateX(-3px); }
.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  font-size: 0.68rem;
  font-weight: 600;
  color: #0b7a55;
}
.auth-secure i { font-size: 0.75rem; }

.auth-mobile-brand { display: none; }

.auth-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
}
.auth-card .auth-eyebrow {
  border-color: rgba(42, 91, 255, 0.18);
  background: rgba(42, 91, 255, 0.06);
  color: var(--brand-700);
}
.auth-card .auth-eyebrow .dot { background: var(--brand); }
.auth-card h1 {
  font-size: clamp(1.6rem, 2.4vw, 1.95rem);
  letter-spacing: -0.035em;
}
.auth-sub {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--sh-xs, 0 1px 2px rgba(10, 27, 51, 0.06));
}
.btn-google svg { width: 18px; height: 18px; flex: none; }
.btn-google:hover { border-color: rgba(42, 91, 255, 0.35); background: #f8fbff; }
.auth-alert + .btn-google { margin-top: 14px; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-or::before,
.auth-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.auth-form { margin-top: 18px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
}
.field-input { position: relative; display: flex; align-items: center; }
.field-input > i {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s ease;
}
.field-input input {
  width: 100%;
  padding: 13px 46px 13px 42px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field-input input::placeholder { color: #9aabc0; }
.field-input input:hover { border-color: rgba(10, 27, 51, 0.28); }
.field-input input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(42, 91, 255, 0.12);
}
.field-input:focus-within > i { color: var(--brand); }
.field-input input:focus-visible { outline: none; }

.field-toggle {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.field-toggle:hover { background: var(--surface-soft); color: var(--brand-700); }

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 22px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--body);
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
  accent-color: var(--brand);
  cursor: pointer;
}
.field-row a {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-700);
}
.field-row a:hover { color: var(--brand); text-decoration: underline; }

.auth-form .btn-ih { margin-top: 2px; }
.auth-form .btn-ih .spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(42, 91, 255, 0.24);
  border-radius: 11px;
  background: #f2f7ff;
  font-size: 0.79rem;
  line-height: 1.55;
  color: #24406e;
}
.auth-alert i { margin-top: 1px; color: var(--brand); }
.auth-alert[hidden] { display: none; }

.auth-alt {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.auth-alt a { font-weight: 700; color: var(--brand-700); }
.auth-alt a:hover { color: var(--brand); text-decoration: underline; }

.auth-help {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 26px;
  padding: 15px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 13px;
  background: #f9fbff;
}
.auth-help i { margin-top: 1px; font-size: 1rem; color: var(--brand); }
.auth-help b { display: block; font-size: 0.82rem; color: var(--ink); }
.auth-help p { margin-top: 2px; font-size: 0.78rem; line-height: 1.6; color: var(--muted); }
.auth-help a { font-weight: 700; color: var(--brand-700); }
.auth-help a:hover { text-decoration: underline; }

.auth-legal {
  margin-top: auto;
  font-size: 0.72rem;
  color: #93a4b8;
  text-align: center;
}
.auth-legal a { color: #6b7f97; }
.auth-legal a:hover { color: var(--brand-700); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  html:has(.auth-page),
  body:has(.auth-page) { height: auto; overflow: auto; }
  .auth-page { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
  .auth-visual { display: none; }
  .auth-main { height: auto; min-height: 100dvh; overflow: visible; padding-inline: clamp(18px, 5vw, 32px); }
  .auth-topbar { display: none; }
  .auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .auth-mobile-brand img.brand-mark { width: auto; height: 32px; max-width: 180px; }
  .auth-mobile-brand a:last-child { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
  .auth-card { margin-block: auto; }
  .auth-legal { margin-top: 32px; }
}

/* ---------- 11. Register / reset password components ---------- */
.auth-card--wide { max-width: 460px; }

.auth-card[hidden],
.auth-form[hidden],
.auth-alt[hidden],
.auth-success[hidden] { display: none; }

/* Password strength */
.strength { margin-top: 9px; }
.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.strength-bars span {
  height: 4px;
  border-radius: 4px;
  background: rgba(10, 27, 51, 0.12);
  transition: background 0.25s ease;
}
.strength[data-level="1"] .strength-bars span:nth-child(-n + 1) { background: #ef4444; }
.strength[data-level="2"] .strength-bars span:nth-child(-n + 2) { background: #f59e0b; }
.strength[data-level="3"] .strength-bars span:nth-child(-n + 3) { background: #2a5bff; }
.strength[data-level="4"] .strength-bars span:nth-child(-n + 4) { background: #0e9f6e; }
.strength-text {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}
.strength-text b { color: var(--ink-2); font-weight: 700; }

/* Aturan kata sandi */
.req-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.req-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.req-list i { font-size: 0.78rem; color: #a9b8ca; transition: color 0.2s ease; }
.req-list li.is-ok { color: #0b7a55; }
.req-list li.is-ok i { color: #0e9f6e; }

/* State berhasil */
.auth-success { text-align: center; padding-top: 4px; }
.auth-success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border: 1px solid rgba(42, 91, 255, 0.18);
  border-radius: 20px;
  background: var(--grad-brand-soft);
  color: var(--brand-700);
  font-size: 1.7rem;
}
.auth-success h1 { font-size: clamp(1.4rem, 2.2vw, 1.7rem); }
.auth-success > p {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.72;
  color: var(--muted);
}
.auth-success .email-echo {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.auth-success .btn-ih { margin-top: 22px; }
.auth-success .field-hint { margin-top: 14px; }

/* Info kecil di bawah field */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.73rem;
  line-height: 1.55;
  color: var(--muted);
}

.check-group { margin: 20px 0 22px; }
.check-group .check { align-items: flex-start; line-height: 1.6; }
.check-group .check input { margin-top: 2px; flex: none; }
.check-group a { color: var(--brand-700); font-weight: 700; }

@media (max-width: 479px) {
  .auth-help { display: none; }
  .field-row { margin: 16px 0 20px; }
  .auth-success-icon { width: 56px; height: 56px; border-radius: 17px; font-size: 1.45rem; }
}
