/* =====================================================================
 *  AUDITRA — Auth Pages Design System (Login, Ganti Password, SSO)
 *  Aesthetic: Executive Precision Split-Canvas (Ancora Navy + Emerald-Teal)
 * ===================================================================== */
:root {
  --navy-950: #0B152A;
  --navy-900: #112040;
  --navy-800: #192C56;
  --cobalt: #23569C;
  --teal: #00A98A;
  --teal-soft: #E6F8F3;
  --lime: #C4DB6E;
  --grad: linear-gradient(90deg, #23569C 0%, #00A98A 58%, #C4DB6E 100%);
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --surface: #FFFFFF;
  --bg: #F4F7FB;
  --err-bg: #FEF2F2;
  --err-border: #FECACA;
  --err-ink: #991B1B;
  --ok-bg: #ECFDF5;
  --ok-border: #A7F3D0;
  --ok-ink: #065F46;
  --warn-bg: #FFFBEB;
  --warn-border: #FDE68A;
  --warn-ink: #92400E;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Split-Canvas Shell ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
}

/* ---------- Left: Executive Brand Showcase ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  color: #F8FAFC;
  background:
    radial-gradient(640px circle at 12% 14%, rgba(0, 169, 138, 0.22), transparent 58%),
    radial-gradient(560px circle at 88% 86%, rgba(35, 86, 156, 0.38), transparent 62%),
    radial-gradient(420px circle at 76% 18%, rgba(196, 219, 110, 0.10), transparent 55%),
    linear-gradient(155deg, var(--navy-950) 0%, var(--navy-900) 48%, #162B54 100%);
}

/* Architectural ledger grid texture */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 85% 75% at 35% 45%, #000 45%, transparent 100%);
  pointer-events: none;
}

/* Top brand accent ribbon */
.auth-brand::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad);
}

.brand-top,
.brand-hero,
.brand-foot {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 16px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.logo-badge img {
  display: block;
  height: 26px;
  width: auto;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #CBD5E1;
}

.env-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 169, 138, 0.22);
}

.brand-hero {
  margin: 42px 0;
  max-width: 500px;
}

.brand-wordmark {
  margin: 0;
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: 2.2px;
  line-height: 1.05;
  color: #FFFFFF;
}

.brand-accent-bar {
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: var(--grad);
  margin: 16px 0 18px;
}

.brand-tagline {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #E2E8F0;
  letter-spacing: -0.2px;
}

.brand-desc {
  margin: 0 0 32px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #94A3B8;
}

.pillars {
  display: grid;
  gap: 12px;
}

.pillar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pillar:hover {
  transform: translateX(4px);
  border-color: rgba(0, 169, 138, 0.35);
  background: rgba(255, 255, 255, 0.075);
}

.pillar-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 169, 138, 0.16);
  border: 1px solid rgba(0, 169, 138, 0.28);
  color: #5EEAD4;
}

.pillar-ic svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pillar b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 2px;
}

.pillar span {
  display: block;
  font-size: 12.5px;
  color: #94A3B8;
  line-height: 1.45;
}

.brand-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #94A3B8;
}

.ver-tag {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
}

/* ---------- Right: Authentication Workspace ---------- */
.auth-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  background:
    radial-gradient(500px circle at 90% 10%, rgba(0, 169, 138, 0.06), transparent 60%),
    radial-gradient(500px circle at 10% 92%, rgba(35, 86, 156, 0.06), transparent 60%),
    #FFFFFF;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mobile-brand img {
  height: 28px;
  width: auto;
  display: block;
}

.mobile-brand-meta b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--navy-800);
}

.mobile-brand-meta span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.auth-head {
  margin-bottom: 24px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.auth-head h1 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  line-height: 1.2;
}

.auth-head p.sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-err {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-ink);
}

.alert-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-ink);
}

.alert-ok a {
  color: #047857;
  font-weight: 700;
}

.alert-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

/* ---------- Primary SSO Button ---------- */
.ssobtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--cobalt) 100%);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  box-shadow: 0 10px 24px -6px rgba(25, 44, 86, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.16s ease;
}

.ssobtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -6px rgba(25, 44, 86, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  filter: brightness(1.04);
}

.ssobtn:active {
  transform: translateY(0);
}

.ssobtn:focus-visible {
  outline: 3px solid rgba(0, 169, 138, 0.55);
  outline-offset: 2px;
}

.ssobtn svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ssobtn .arr {
  margin-inline-start: auto;
  opacity: 0.78;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.ssobtn:hover .arr {
  transform: translateX(3px);
  opacity: 1;
}

/* ---------- Divider ---------- */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 500;
  margin: 22px 0 18px;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Form Fields ---------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: -2px 0 7px;
}

.rules-list {
  margin: 0 0 8px;
  padding: 8px 12px 8px 26px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.field:has(input:user-invalid) .rules-list {
  border-color: var(--err-border);
  background: var(--err-bg);
  color: var(--err-ink);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-ic {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.16s ease;
}

.input-ic svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wrap:focus-within .input-ic {
  color: var(--cobalt);
}

.field input {
  width: 100%;
  min-height: 48px;
  font: inherit;
  font-size: max(1rem, 15px);
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  padding: 11px 14px 11px 42px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.field input.has-toggle {
  padding-right: 48px;
}

.field input::placeholder {
  color: #94A3B8;
}

.field input:hover {
  border-color: #94A3B8;
}

.field input:focus-visible {
  outline: 2px solid transparent;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3.5px rgba(35, 86, 156, 0.16);
}

.field input:user-invalid {
  border-color: #DC2626;
  background-color: #FEF2F2;
}

.field input:user-valid {
  border-color: #059669;
}

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--err-ink);
  line-height: 1.4;
}

.field:has(input:user-invalid) .field-error {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Accessible Show/Hide Password Button */
.pw-toggle {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pw-toggle:hover {
  background: #F1F5F9;
  color: var(--ink);
}

.pw-toggle:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 1px;
}

.pw-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pw-toggle .ic-off { display: none; }
.pw-toggle[aria-pressed="true"] .ic-on { display: none; }
.pw-toggle[aria-pressed="true"] .ic-off { display: block; }

/* ---------- Submit Buttons ---------- */
.btn-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 13px;
  padding: 12px 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--cobalt) 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -6px rgba(25, 44, 86, 0.38);
  transition: transform 0.15s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -6px rgba(25, 44, 86, 0.45);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:focus-visible {
  outline: 3px solid rgba(0, 169, 138, 0.55);
  outline-offset: 2px;
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-submit.sec {
  background: #FFFFFF;
  color: var(--navy-800);
  border: 1.5px solid #CBD5E1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-submit.sec:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: var(--cobalt);
  color: var(--cobalt);
  box-shadow: 0 4px 12px rgba(35, 86, 156, 0.1);
}

/* ---------- Footer & Links ---------- */
.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.auth-links a {
  color: var(--cobalt);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive (Tablet & Mobile) ---------- */
@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .auth-main {
    min-height: 100vh;
    justify-content: flex-start;
    padding: 28px 20px 36px;
    background:
      radial-gradient(460px circle at 10% 0%, rgba(0, 169, 138, 0.1), transparent 55%),
      radial-gradient(460px circle at 95% 100%, rgba(35, 86, 156, 0.1), transparent 55%),
      var(--bg);
  }
  .auth-card {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 26px 22px;
    box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.1);
  }
  .mobile-brand {
    display: flex;
  }
  .auth-head h1 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .pillar,
  .ssobtn,
  .ssobtn .arr,
  .btn-submit,
  .field input {
    animation: none !important;
    transition: none !important;
  }
}

