/* ==================================
   1. WARNA DAN PENGATURAN DASAR
================================== */

:root {
  --green: #17684d;
  --green-dark: #104b38;
  --green-light: #edf5ef;

  --background: #f5f7f5;
  --white: #ffffff;

  --text: #243d32;
  --muted: #64756b;
  --border: #dfe7e1;

  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

h1,
h2,
p {
  margin-top: 0;
}


/* ==================================
   2. SIDEBAR
================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;

  width: 240px;
  height: 100dvh;
  overflow-y: auto;

  display: flex;
  flex-direction: column;

  padding: 32px 22px;
  background: var(--white);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
}

.brand-icon {
  display: grid;
  place-items: center;

  width: 44px;
  height: 44px;

  background: var(--green);
  color: var(--white);

  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -1px;
}

.brand small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
}

.nav-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--green);
  font-weight: 600;
  transition: background 0.2s;
}

nav a:hover {
  background: var(--green-light);
}

.sidebar-info {
  margin-top: 40px;
  padding: 18px;

  background: #f3f5ec;
  border: 1px solid #e4e9d8;
  border-radius: 10px;
}

.sidebar-info strong {
  font-size: 13px;
}

.sidebar-info p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer {
  margin: auto 0 0;
  padding-top: 28px;
  color: var(--muted);
  font-size: 11px;
}


/* ==================================
   3. BAGIAN UTAMA DAN HEADER
================================== */

.page {
  margin-left: 240px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  min-height: 72px;
  padding: 16px 40px;

  background: var(--white);
  border-bottom: 1px solid var(--border);

  color: var(--muted);
  font-size: 12px;
}

.topbar strong {
  color: var(--text);
  font-weight: 500;
}

.organization {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 40px 0;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
}

.page-heading {
  margin-bottom: 26px;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.8px;
}

.page-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}


/* ==================================
   4. BANNER HIJAU
================================== */

.banner {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 190px;
  margin-bottom: 26px;
  padding: 30px;

  background: linear-gradient(110deg, #15563e, #247655);
  color: var(--white);
  border-radius: var(--radius);
}

.banner > div {
  position: relative;
  z-index: 1;
}

.banner-label {
  display: inline-block;
  padding: 5px 9px;

  background: #ffffff12;
  border: 1px solid #ffffff30;
  border-radius: 5px;

  color: #e0edcd;
  font-size: 9px;
  letter-spacing: 1px;
}

.banner h2 {
  margin: 16px 0 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
}

.banner p {
  max-width: 420px;
  margin-bottom: 0;
  color: #daebe0;
  font-size: 12px;
}

.banner-decoration {
  display: grid;
  place-items: center;
  flex-shrink: 0;

  width: 135px;
  height: 135px;
  margin-left: 20px;

  border: 1px solid #ffffff35;
  border-radius: 50%;

  color: #d7e8b9;
  font-size: 94px;
  line-height: 1;

  transform: rotate(-12deg);
}


/* ==================================
   5. KARTU DAN SUSUNAN KONTEN
================================== */

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgb(25 60 40 / 3%);
}

.form-card {
  min-width: 0;
  padding: 26px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;

  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.card-heading h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.card-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.required-note {
  padding-top: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}


/* ==================================
   6. FORMULIR
================================== */

fieldset {
  min-width: 0;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

legend {
  display: flex;
  align-items: center;
  gap: 9px;

  width: 100%;
  margin-bottom: 18px;
  padding: 0;

  font-size: 13px;
  font-weight: 600;
}

.section-number {
  display: inline-grid;
  place-items: center;

  width: 26px;
  height: 26px;

  background: var(--green-light);
  color: var(--green);
  border-radius: 6px;

  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.form-group {
  min-width: 0;
}

.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.required {
  color: #b44835;
}

.form-group input,
.form-group select {
  display: block;

  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 12px;

  background: var(--white);
  color: var(--text);

  border: 1px solid #cfdad1;
  border-radius: 7px;
  outline: none;

  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
  color: #78857d;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(23 104 77 / 10%);
}

.form-group small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.confirmation {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin: 25px 0;
  padding: 14px;

  background: #f5f8f3;
  border-radius: 7px;

  color: #54675b;
  font-size: 11px;
}

.confirmation input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: 100%;
  min-height: 48px;
  padding: 12px 20px;

  background: var(--green);
  color: var(--white);

  border: 0;
  border-radius: 7px;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.submit-button:hover:not(:disabled) {
  background: var(--green-dark);
}

.submit-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.submit-button span {
  font-size: 20px;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}


/* ==================================
   7. PANDUAN DAN FOOTER
================================== */

.guide-column {
  display: grid;
  gap: 20px;
}

.guide-card {
  padding: 24px;
}

.guide-card h2 {
  margin-bottom: 24px;
  font-size: 18px;
}

.steps {
  margin: 0;
  padding-left: 21px;
}

.steps li {
  padding-left: 6px;
}

.steps li + li {
  margin-top: 22px;
}

.steps li::marker {
  color: var(--green);
  font-weight: 700;
}

.steps strong {
  font-size: 12px;
}

.steps p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.info-card {
  padding: 24px;
  background: #f0f2e5;
  border: 1px solid #dee4cc;
  border-radius: var(--radius);
}

.info-card h2 {
  margin-bottom: 10px;
  color: #4c613f;
  font-size: 14px;
}

.info-card p {
  margin-bottom: 0;
  color: #617052;
  font-size: 12px;
  line-height: 1.8;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;

  padding: 28px 0;
  color: var(--muted);
  font-size: 10px;
}


/* ==================================
   8. TAMPILAN TABLET
================================== */

@media (max-width: 1100px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-column {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .banner-decoration {
    width: 100px;
    height: 100px;
    font-size: 72px;
  }
}


/* ==================================
   9. TAMPILAN SMARTPHONE
================================== */

@media (max-width: 760px) {
  .sidebar {
    position: static;

    width: 100%;
    height: auto;
    padding: 18px 20px;

    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    margin-bottom: 18px;
  }

  .brand strong {
    font-size: 24px;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  nav {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  nav a {
    background: var(--green-light);
    text-align: center;
    font-size: 12px;
  }

  .nav-title,
  .sidebar-info,
  .sidebar-footer {
    display: none;
  }

  .page {
    margin-left: 0;
  }

  .topbar {
    min-height: 54px;
    padding: 14px 20px;
    font-size: 10px;
  }

  .organization {
    display: none;
  }

  main {
    padding: 25px 18px 0;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .page-heading > p:last-child {
    font-size: 12px;
  }

  .banner {
    min-height: 180px;
    padding: 25px;
  }

  .banner h2 {
    max-width: 260px;
    font-size: 23px;
  }

  .banner p {
    max-width: 260px;
  }

  .banner-label {
    font-size: 8px;
  }

  .banner-decoration {
    position: absolute;
    right: -25px;
    bottom: -25px;

    width: 130px;
    height: 130px;

    opacity: 0.15;
    font-size: 100px;
  }

  .form-card {
    padding: 22px 18px;
  }

  .card-heading {
    flex-direction: column;
    gap: 8px;
  }

  .required-note {
    padding-top: 0;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
  }

  .guide-column {
    grid-template-columns: 1fr;
  }

  .page-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Pemberitahuan formulir */
.message {
  margin-top: 20px;
  padding: 14px 16px;

  background: #fff8e6;
  color: #765719;

  border: 1px solid #ead69f;
  border-radius: 8px;

  font-size: 12px;
}

/* Memastikan elemen hidden benar-benar tersembunyi */
[hidden] {
  display: none !important;
}

/* Dialog pemeriksaan */
.review-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: 0;

  background: var(--white);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  overflow-y: auto;
  box-shadow: 0 20px 70px rgb(0 0 0 / 20%);
}

.review-dialog::backdrop {
  background: rgb(15 35 26 / 55%);
}

.review-content {
  padding: 26px;
}

.review-content h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

.review-content > p {
  color: var(--muted);
  font-size: 12px;
}

/* Daftar data dalam dialog */
.review-list {
  margin: 22px 0;
}

.review-list > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;

  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.review-list dt {
  color: var(--muted);
  font-size: 12px;
}

.review-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.review-note {
  padding: 12px;
  background: #f5f8f3;
  border-radius: 7px;
}

.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.review-actions button {
  flex: 1;
}

.back-button {
  min-height: 48px;
  padding: 12px 16px;

  background: var(--white);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 7px;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.back-button:hover {
  background: var(--background);
}

/* Penyesuaian dialog di smartphone */
@media (max-width: 480px) {
  .review-content {
    padding: 22px 18px;
  }

  .review-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .review-actions {
    flex-direction: column;
  }
}

/* Logo PUK OMRON */
.brand-with-logo {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 196px;
  height: auto;
}

.brand-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Ukuran logo pada smartphone */
@media (max-width: 760px) {
  .brand-with-logo {
    align-items: center;
    gap: 10px;
  }

  .brand-logo {
    max-width: 210px;
  }
}

/* ==================================
   FORMULIR DI TENGAH
================================== */

.content-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}

.form-card {
  width: 100%;
  padding: 32px;
}

nav a[aria-current="page"] {
  background: var(--green-light);
}


/* ==================================
   TOMBOL PILIHAN TEMA
================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 14px;

  background: var(--white);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 20px;

  font-size: 12px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--green-light);
}

#ikon-tema {
  font-size: 19px;
  line-height: 1;
}


/* ==================================
   LOGO DI BAWAH HALAMAN
================================== */

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  margin-top: 36px;
  padding: 30px 12px;

  border-top: 1px solid var(--border);
  text-align: center;
}

/* Logo biru tetap terbaca pada tema gelap */
.footer-logo-box {
  padding: 12px 18px;
  background: #ffffff;
  border-radius: 10px;
}

.footer-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.footer-brand p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.footer-brand small {
  color: var(--muted);
  font-size: 11px;
}


/* ==================================
   TEMA TERANG
================================== */

:root {
  color-scheme: light;
}


/* ==================================
   TEMA GELAP
================================== */

html[data-theme="dark"] {
  color-scheme: dark;

  --green: #8bd9b4;
  --green-dark: #b0ebce;
  --green-light: #253f34;

  --background: #111a16;
  --white: #1b2721;

  --text: #e8f1eb;
  --muted: #b0bfb5;
  --border: #35483c;
}

html[data-theme="dark"] .brand-icon {
  color: #10291d;
}

html[data-theme="dark"] .sidebar-info {
  background: #243126;
  border-color: var(--border);
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select {
  background: #152019;
  border-color: #4d6354;
}

html[data-theme="dark"] .form-group input::placeholder {
  color: #a3b3a7;
}

html[data-theme="dark"] .confirmation,
html[data-theme="dark"] .review-note {
  background: #25352a;
  color: #c4d4c8;
}

html[data-theme="dark"] .required {
  color: #ffad9e;
}

html[data-theme="dark"] .submit-button {
  color: #10291d;
}

html[data-theme="dark"] .message {
  background: #393321;
  color: #f0d99d;
  border-color: #75613a;
}


/* ==================================
   PENYESUAIAN SMARTPHONE
================================== */

@media (max-width: 760px) {
  nav {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 24px 18px;
  }

  .topbar {
    gap: 12px;
  }

  .theme-toggle {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .footer-brand {
    margin-top: 26px;
    padding-block: 26px;
  }

  .footer-logo {
    width: 170px;
  }
}

/* Menghilangkan kotak putih di belakang logo */
.footer-logo-box {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Ukuran logo desktop */
.footer-logo {
  width: 300px;
  max-width: 100%;
  height: auto;
}

/* Ukuran logo smartphone */
@media (max-width: 760px) {
  .footer-logo {
    width: 240px;
  }
}