/*--------------------------------------------------------------
# Auth split layout (login, register)
# Kiri: gambar penuh. Kanan: form. < 992px: gambar disembunyikan.
# Semua kelas diberi prefiks "auth-" agar tidak bentrok dengan main.css.
--------------------------------------------------------------*/

.auth-body {
  --auth-accent: var(--accent-color, #ed1b2e);
  --auth-accent-dark: #c8142a;
  --auth-ink: #10242a;
  --auth-muted: #5f6b70;
  --auth-line: #d3d9dc;
  --auth-error: #c0182a;
  --auth-radius: 10px;

  margin: 0;
  background-color: #fff;
  color: var(--auth-ink);
}

/*--------------------------------------------------------------
# Layout
--------------------------------------------------------------*/
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 992px) {
  .auth-split {
    grid-template-columns: minmax(0, 11fr) minmax(440px, 9fr);
  }
}

/* Panel gambar (kiri) */
.auth-visual {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  align-items: flex-start;
  background-color: #1c4b56;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 30, 35, 0.7) 0%, rgba(5, 30, 35, 0.15) 35%, rgba(5, 30, 35, 0.45) 100%);
}

.auth-visual-brand {
  padding: 40px 48px;
}

.auth-visual-brand img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

/* Panel form (kanan) */
.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 24px 16px;
  overflow: hidden;
  background-color: #f6f8f9;
}

/* Lingkaran dekoratif samar */
.auth-panel::before,
.auth-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background-color: var(--auth-accent);
  opacity: 0.06;
  pointer-events: none;
}

.auth-panel::before {
  top: -120px;
  right: -100px;
  width: 320px;
  height: 320px;
}

.auth-panel::after {
  bottom: -90px;
  left: -80px;
  width: 240px;
  height: 240px;
}

.auth-panel-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: auto;
}

.auth-brand {
  margin-bottom: 20px;
}

.auth-brand img {
  display: block;
  width: 150px;
  height: auto;
}

/* Kartu form */
.auth-card {
  padding: 32px;
  border: 1px solid #e3e8ea;
  border-top: 4px solid var(--auth-accent);
  border-radius: 16px;
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(16, 36, 42, 0.08);
}

.auth-copy {
  position: relative;
  z-index: 1;
  margin: 24px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
}

/*--------------------------------------------------------------
# Heading
--------------------------------------------------------------*/
.auth-heading {
  margin-bottom: 24px;
}

.auth-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 50%;
  background-color: rgba(237, 27, 46, 0.1);
  color: var(--auth-accent-dark);
  font-size: 22px;
}

.auth-heading h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-heading h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background-color: var(--auth-accent);
}

.auth-heading p {
  margin: 12px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
}

/*--------------------------------------------------------------
# Links
--------------------------------------------------------------*/
.auth-body .link-pru {
  color: #5f5f5f;
  text-decoration: none;
}

.auth-body .link-pru:hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

.auth-heading .link-pru {
  color: var(--auth-accent-dark);
}

.auth-body a:focus-visible,
.auth-body button:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.auth-body .required {
  color: var(--auth-accent);
}

/*--------------------------------------------------------------
# Tabs (segmented)
--------------------------------------------------------------*/
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
  background-color: #eef1f2;
}

.auth-tabs .nav-link {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-tabs .nav-link:hover {
  color: var(--auth-ink);
}

.auth-tabs .nav-link.active {
  background-color: #fff;
  color: var(--auth-accent-dark);
  box-shadow: 0 1px 4px rgba(16, 36, 42, 0.15);
}

/*--------------------------------------------------------------
# Form
--------------------------------------------------------------*/
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 500;
}

.auth-body .form-control {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  background-color: #fff;
  color: var(--auth-ink);
  font-size: 15px;
  box-shadow: none;
}

.auth-body .form-control::placeholder {
  color: #7b868b;
}

.auth-body .form-control:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px rgba(237, 27, 46, 0.14);
}

.auth-body .form-control.is-invalid {
  padding-right: 14px;
  border-color: var(--auth-error);
  background-image: none;
}

.auth-body .form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(192, 24, 42, 0.14);
}

.auth-body .input-group > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.auth-body .input-group > .btn,
.auth-body .input-group > .input-group-text {
  min-width: 48px;
  border: 1px solid var(--auth-line);
  border-left: 0;
  border-radius: 0 var(--auth-radius) var(--auth-radius) 0;
  background-color: #fff;
  color: var(--auth-muted);
}

.auth-body .input-group > .btn:hover {
  background-color: #f4f6f7;
  color: var(--auth-ink);
}

.auth-body .input-group:focus-within > .btn,
.auth-body .input-group:focus-within > .input-group-text {
  border-color: var(--auth-accent);
}

/* Pesan jQuery Validate memakai errorClass global "invalid-feedback" (prudent.js) */
.auth-body .invalid-feedback {
  margin-top: 6px;
  color: var(--auth-error);
  font-size: 13px;
}

.auth-hint {
  display: block;
  margin-top: 6px;
  color: var(--auth-muted);
  font-size: 13px;
}

/* Captcha: gambar + refresh di kiri, input kode di kanan (wrap bila sempit) */
.auth-captcha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.auth-captcha .div-img-captcha {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.auth-captcha .div-img-captcha img {
  display: block;
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.auth-captcha-input {
  flex: 1 1 100px;
}

.auth-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--auth-muted);
  font-size: 18px;
}

.auth-icon-btn:hover {
  background-color: #eef1f2;
  color: var(--auth-ink);
}

/* Tombol utama */
.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--auth-radius);
  background-color: var(--auth-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus {
  background-color: var(--auth-accent-dark);
  color: #fff;
}

/* Tombol submit terkunci selama proses */
.auth-submit:disabled {
  background-color: #b9bfc2;
  color: #fff;
  cursor: not-allowed;
}

/* Tombol utama berbentuk link (mis. kembali ke halaman depan) */
a.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-heading-center {
  text-align: center;
}

.auth-heading-center h1::after {
  margin-right: auto;
  margin-left: auto;
}

/* Daftar aturan kata sandi */
.auth-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-rules li.is-met {
  color: #1a7f45;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e9edef;
  font-size: 14px;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/*--------------------------------------------------------------
# Layar pendek (laptop dengan skala besar)
--------------------------------------------------------------*/
@media (max-height: 700px) {
  .auth-panel {
    padding-top: 16px;
  }

  .auth-heading {
    margin-bottom: 16px;
  }

  .auth-heading h1 {
    font-size: 26px;
  }

  .auth-tabs {
    margin-bottom: 16px;
  }

  .auth-form {
    gap: 12px;
  }

  .auth-body .form-control,
  .auth-submit {
    height: 44px;
  }

  .auth-links {
    margin-top: 0;
    padding-top: 0;
  }

  .auth-copy {
    margin-top: 8px;
  }

  .auth-card {
    padding: 20px 24px;
  }

  .auth-heading-icon,
  .auth-panel::before,
  .auth-panel::after {
    display: none;
  }

  .auth-heading h1::after {
    margin-top: 6px;
  }

  .auth-heading p {
    margin-top: 8px;
  }
}

@media (max-width: 575.98px) {
  .auth-panel {
    padding: 16px 12px;
  }

  .auth-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-body * {
    transition: none !important;
  }
}

/*--------------------------------------------------------------
# Alert registrasi (SweetAlert2, customClass "auth-alert")
--------------------------------------------------------------*/
.swal2-modal.auth-alert {
  width: 440px;
  max-width: 92vw;
  padding: 32px 28px 28px;
  border-top: 4px solid #ed1b2e;
  border-radius: 16px;
  text-align: left;
}

.auth-alert .swal2-header,
.auth-alert .swal2-title {
  display: none;
}

.auth-alert .swal2-content {
  padding: 0;
  text-align: left;
}

.auth-alert-body {
  color: #10242a;
  text-align: center;
}

.auth-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #e3f4ea;
  color: #1a7f45;
  font-size: 32px;
}

.auth-alert-title {
  margin: 16px 0 8px;
  color: #10242a;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.auth-alert-greet {
  margin: 0 0 20px;
  color: #5f6b70;
  font-size: 15px;
  line-height: 1.5;
}

.auth-alert-greet strong {
  color: #10242a;
}

.auth-alert-list {
  margin: 0;
  padding: 4px 16px;
  border: 1px solid #e3e8ea;
  border-radius: 12px;
  background-color: #f6f8f9;
  text-align: left;
}

.auth-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  font-size: 14px;
}

.auth-alert-row + .auth-alert-row {
  border-top: 1px solid #e3e8ea;
}

.auth-alert-row dt {
  margin: 0;
  color: #5f6b70;
  font-weight: 500;
}

.auth-alert-row dd {
  margin: 0;
  color: #10242a;
  font-weight: 600;
  text-align: right;
}

.auth-alert-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: #fde8ea;
  color: #a5111f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.auth-alert-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  color: #5f6b70;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.auth-alert-note i {
  margin-top: 2px;
  color: #1a5fa8;
}

.auth-alert .swal2-actions {
  margin-top: 24px;
}

.auth-alert-confirm {
  min-width: 120px;
  height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 10px;
  background-color: #ed1b2e;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.auth-alert-confirm:hover,
.auth-alert-confirm:focus {
  background-color: #c8142a;
}

.auth-alert-confirm:focus-visible {
  outline: 2px solid #ed1b2e;
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .swal2-modal.auth-alert {
    padding: 24px 16px 20px;
  }

  .auth-alert-row {
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* Datepicker pop-up (jQuery UI) untuk input tanggal lahir */
.ui-datepicker {
  z-index: 1080 !important;
  width: 19em;
  padding: 10px;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 36, 42, 0.18);
  color: var(--auth-ink);
  font-family: inherit;
}

.ui-datepicker .ui-datepicker-header {
  padding: 4px 0 8px;
  border: 0;
  background: transparent;
}

.ui-datepicker .ui-datepicker-title select {
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--auth-line);
  border-radius: 6px;
  background: #fff;
  color: var(--auth-ink);
  font-size: 0.875rem;
}

.ui-datepicker .ui-datepicker-title select:focus {
  border-color: var(--auth-accent);
  outline: 0;
}

.ui-datepicker th {
  color: var(--auth-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.ui-datepicker td span,
.ui-datepicker td a {
  padding: 7px 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--auth-ink);
  text-align: center;
}

.ui-datepicker td a:hover {
  background: #f4f6f7;
}

.ui-datepicker td a.ui-state-highlight {
  border-color: var(--auth-line);
}

.ui-datepicker td a.ui-state-active {
  background: var(--auth-accent);
  color: #fff;
}

.ui-datepicker td.ui-state-disabled span {
  color: var(--auth-line);
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  cursor: pointer;
}

@media (max-width: 575.98px) {
  .ui-datepicker {
    width: min(19em, calc(100vw - 32px));
  }
}

/* Panah bulan: sprite ikon jQuery UI tidak tersedia di tema v1, pakai CSS murni */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  border-radius: 6px;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
  background: #f4f6f7;
}

.ui-datepicker .ui-datepicker-prev .ui-icon,
.ui-datepicker .ui-datepicker-next .ui-icon {
  width: 0;
  height: 0;
  margin: 0;
  background: none;
  overflow: hidden;
  text-indent: 0;
}

.ui-datepicker .ui-datepicker-prev::before,
.ui-datepicker .ui-datepicker-next::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-top: 2px solid var(--auth-muted);
  border-left: 2px solid var(--auth-muted);
  content: "";
}

.ui-datepicker .ui-datepicker-prev::before {
  margin-left: -2px;
  transform: rotate(-45deg);
}

.ui-datepicker .ui-datepicker-next::before {
  margin-left: -5px;
  transform: rotate(135deg);
}
