/*-----------------------------------*\
  #app.css — Domain Expired Checker
  Bahasa visual mengikuti codewithsadee/dashboard:
  token, reset, reused style, header, layout, breakpoint, tema gelap.
  Komponen aplikasi ada di components.css.
\*-----------------------------------*/

/*-----------------------------------*\
  #CUSTOM PROPERTY
\*-----------------------------------*/

:root {
  /* colors (style-guide codewithsadee) */
  --imperial-red_12: hsla(357, 86%, 57%, 0.12);
  --pacific-blue_12: hsla(188, 78%, 41%, 0.12);
  --davys-gray_12: hsla(210, 9%, 31%, 0.12);
  --imperial-red: hsl(357, 86%, 57%);
  --sonic-sliver: hsl(0, 0%, 47%);
  --pacific-blue: hsl(188, 78%, 41%);
  --blue-ryb_12: hsla(220, 100%, 50%, 0.12);
  --space-cadet: hsl(220, 41%, 20%);
  --eerie-black: hsl(214, 10%, 13%);
  --davys-gray: hsl(210, 9%, 31%);
  --emerald_12: hsla(144, 62%, 53%, 0.12);
  --cool-gray: hsl(225, 11%, 59%);
  --cultured: hsl(225, 20%, 96%);
  --blue-ryb: hsl(220, 100%, 50%);
  --black_08: hsla(0, 0%, 0%, 0.06);
  --black_12: hsla(0, 0%, 0%, 0.12);
  --coral_12: hsla(15, 100%, 65%, 0.12);
  --sunglow: hsl(44, 100%, 61%);
  --sunglow_12: hsla(44, 100%, 61%, 0.16);
  --emerald: hsl(144, 62%, 53%);
  --onyx-2: hsl(210, 10%, 23%);
  --coral: hsl(15, 100%, 65%);
  --white: hsl(0, 0%, 100%);
  --onyx: hsl(207, 8%, 21%);

  /* token semantik aplikasi (dipetakan dari palet di atas; di-override tema gelap) */
  --page-bg: var(--cultured);
  --surface: var(--white);
  --surface-2: hsl(225, 20%, 98%);
  --text: var(--onyx);
  --text-2: var(--davys-gray);
  --text-3: var(--cool-gray);
  --line: var(--black_12);
  --line-soft: var(--black_08);
  --input-bg: var(--white);
  --input-border: hsl(225, 14%, 86%);
  --accent: var(--blue-ryb);
  --accent_12: var(--blue-ryb_12);

  /* typography */
  --ff-vietnam: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-1: 1.563rem;
  --fs-2: 1.5rem;
  --fs-3: 1.25rem;
  --fs-4: 1.078rem;
  --fs-5: 1rem;
  --fs-6: 0.938rem;
  --fs-7: 0.875rem;
  --fs-8: 0.844rem;
  --fs-9: 0.813rem;
  --fs-10: 0.769rem;
  --fw-500: 500;
  --fw-600: 600;

  /* transition */
  --transition: 0.25s ease;
  --cubic-out: cubic-bezier(0.45, 0.85, 0.5, 1);
  --cubic-in: cubic-bezier(0.5, 0, 0.50, 0.95);

  /* radius */
  --radius-6: 6px;

  /* shadow */
  --shadow-1: 0 12px 20px hsla(210, 10%, 23%, 0.07);
  --shadow-2: 0 2px 10px hsla(0, 0%, 0%, 0.04);
  --shadow-3: 0 2px 20px var(--black_08);

  color-scheme: light;
}

/* Tema gelap: hanya meng-override token, komponen tidak berubah. */
:root[data-theme="dark"] {
  --page-bg: hsl(214, 10%, 11%);
  --surface: hsl(210, 10%, 16%);
  --surface-2: hsl(210, 10%, 20%);
  --text: hsl(210, 20%, 92%);
  --text-2: hsl(210, 14%, 78%);
  --text-3: hsl(220, 10%, 62%);
  --line: hsla(0, 0%, 100%, 0.14);
  --line-soft: hsla(0, 0%, 100%, 0.08);
  --input-bg: hsl(210, 10%, 13%);
  --input-border: hsla(0, 0%, 100%, 0.16);
  --accent: hsl(220, 100%, 66%);
  --accent_12: hsla(220, 100%, 66%, 0.16);
  --onyx: var(--text);
  --onyx-2: var(--text);
  --space-cadet: var(--text);
  --davys-gray: var(--text-2);
  --cool-gray: var(--text-3);
  --sonic-sliver: var(--text-2);
  --white: var(--surface);
  --cultured: var(--page-bg);
  --black_08: hsla(0, 0%, 100%, 0.08);
  --black_12: hsla(0, 0%, 100%, 0.14);
  --davys-gray_12: hsla(210, 14%, 78%, 0.14);
  --blue-ryb: var(--accent);
  --blue-ryb_12: var(--accent_12);
  --shadow-1: 0 12px 20px hsla(0, 0%, 0%, 0.35);
  --shadow-2: 0 2px 10px hsla(0, 0%, 0%, 0.3);
  --shadow-3: 0 2px 20px hsla(0, 0%, 0%, 0.4);
  color-scheme: dark;
}

/*-----------------------------------*\
  #RESET
\*-----------------------------------*/

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

li { list-style: none; }
a { text-decoration: none; color: inherit; }
a, img, span, data, time, button, span.icon { display: block; }
input, select, textarea, button { font: inherit; color: inherit; }

button {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
button:disabled { cursor: not-allowed; opacity: 0.55; }

html {
  font-family: var(--ff-vietnam);
  scroll-behavior: smooth;
}

body {
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-block-start: 72px;
}
body.is-auth { padding-block-start: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: hsl(0, 0%, 75%); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: hsl(0, 0%, 65%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/*-----------------------------------*\
  #REUSED STYLE
\*-----------------------------------*/

.container { padding-inline: 15px; }

.icon-box { font-variation-settings: 'wght' 300; }
.icon-box .icon { font-size: 22px; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}
span.icon { display: inline-block; }

.h2, .h3 { color: var(--onyx-2); font-weight: var(--fw-600); }
.h2 { font-size: var(--fs-3); }

.is-hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: var(--fs-9); }
.strong { font-weight: var(--fw-600); color: var(--onyx); }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; word-break: break-word; }

.card {
  background: var(--surface);
  position: relative;
  padding: 24px;
  border-radius: var(--radius-6);
  box-shadow: var(--shadow-2);
}
.card + .card, .card + section, section + .card { margin-top: 25px; }

.card-title {
  color: var(--onyx);
  font-weight: var(--fw-600);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-title .icon { font-size: 20px; color: var(--accent); }
.card-subtitle { color: var(--cool-gray); font-size: var(--fs-7); }
.card-text { color: var(--cool-gray); font-size: var(--fs-6); line-height: 1.7; }

.divider { height: 1px; background: var(--bg-divider, var(--black_08)); margin-block: var(--mb, 8px); }
.card-divider { --bg-divider: var(--black_12); --mb: 25px; }

.section-title-wrapper {
  padding-block: 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}
.section-title {
  color: var(--onyx);
  font-size: var(--fs-5);
  font-weight: var(--fw-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-title { margin-bottom: 6px; }
.article-subtitle {
  color: var(--davys-gray);
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  margin-bottom: 25px;
}

/* Tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: var(--fs-9);
  font-weight: var(--fw-600);
  padding: 8px 16px;
  border-radius: var(--radius-6);
  white-space: nowrap;
  transition: var(--transition);
}
.btn .icon { font-size: 16px; font-variation-settings: 'wght' 400; }
.btn-link { color: var(--accent); }
.btn-link:is(:hover, :focus-visible) { background: var(--accent_12); }
.btn-primary { color: var(--accent); border: 1px solid var(--accent); }
.btn-primary:is(:hover, :focus-visible):not(:disabled) {
  background: var(--accent);
  color: hsl(0, 0%, 100%);
  box-shadow: 0 10px 10px -8px var(--accent);
}
.btn-ghost { color: var(--davys-gray); border: 1px solid var(--line); }
.btn-ghost:is(:hover, :focus-visible):not(:disabled) { background: var(--black_08); color: var(--onyx); }
.btn-danger { color: var(--imperial-red); border: 1px solid var(--imperial-red); }
.btn-danger:is(:hover, :focus-visible) { background: var(--imperial-red); color: hsl(0, 0%, 100%); }
.btn-block { width: 100%; }

.btn-tiny {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  padding: 4px 10px;
  border-radius: var(--radius-6);
  border: 1px solid var(--line);
  color: var(--davys-gray);
  background: var(--surface);
  transition: var(--transition);
}
.btn-tiny:is(:hover, :focus-visible):not(:disabled) { background: var(--black_08); color: var(--onyx); }
.btn-tiny.is-active { background: var(--accent); border-color: var(--accent); color: hsl(0, 0%, 100%); }
.btn-tiny.danger { color: var(--imperial-red); }
.btn-tiny.danger:is(:hover, :focus-visible) { background: var(--imperial-red_12); }

.link-btn {
  display: inline;
  color: var(--accent);
  font-weight: var(--fw-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--onyx);
  padding: 8px;
  border-radius: var(--radius-6);
  transition: var(--transition);
}
.icon-btn:is(:hover, :focus-visible) { background: var(--black_08); }
.icon-btn .icon { font-size: 22px; }

/* Badge */
.card-badge {
  display: inline-block;
  background: var(--badge-bg, var(--davys-gray_12));
  color: var(--badge-color, var(--davys-gray));
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  width: max-content;
  padding: 3px 8px;
  border-radius: var(--radius-6);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.card-badge.blue { --badge-bg: var(--blue-ryb_12); --badge-color: var(--blue-ryb); }
.card-badge.orange { --badge-bg: var(--coral_12); --badge-color: var(--coral); }
.card-badge.cyan { --badge-bg: var(--pacific-blue_12); --badge-color: var(--pacific-blue); }
.card-badge.red { --badge-bg: var(--imperial-red_12); --badge-color: var(--imperial-red); }
.card-badge.green { --badge-bg: var(--emerald_12); --badge-color: hsl(144, 62%, 38%); }
:root[data-theme="dark"] .card-badge.green { --badge-color: var(--emerald); }
.card-badge.radius-pill { border-radius: 50px; }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--page-bg);
  border-radius: var(--radius-6);
  overflow: hidden;
}
/* Sama seperti referensi: warna isi lewat --bg inline (style="--width: 60%; --bg: var(--emerald)"). */
.progress { width: var(--width, 100%); height: 100%; background: var(--bg, var(--accent)); transition: width 0.3s ease; }

/*-----------------------------------*\
  #HEADER
\*-----------------------------------*/

.header {
  background: var(--surface);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  padding-block: 16px;
  overflow: hidden;
  transition: 0.3s var(--cubic-in);
  box-shadow: var(--shadow-3);
  z-index: 10;
}
/* Admin punya 6 menu + baris aksi user; batasi ke tinggi layar dan biarkan navbar menggulir. */
.header.active { height: 520px; max-height: 100vh; transition: 0.5s var(--cubic-out); }

.header > .container { display: flex; justify-content: space-between; align-items: center; }

.logo {
  font-size: var(--fs-2);
  font-weight: var(--fw-600);
  color: var(--space-cadet);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.brand-mark { color: var(--accent); font-size: 1.1em; }

.menu-toggle-btn { color: var(--onyx); }
.menu-toggle-btn .icon { font-size: 28px; }

.navbar {
  position: absolute;
  top: 72px;
  left: 0;
  width: 100%;
  background: var(--surface);
  opacity: 0;
  visibility: hidden;
  transition: 0.5s var(--cubic-out);
}
.header.active .navbar { opacity: 1; visibility: visible; max-height: calc(100vh - 72px); overflow-y: auto; }

.navbar-list { padding-inline: 15px; margin-bottom: 15px; }

.navbar-link {
  color: var(--onyx);
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-6);
  transition: var(--transition);
  white-space: nowrap;
}
:is(.navbar-link, .header-profile):is(:hover, :focus-visible) { background: var(--black_08); }
.navbar-link.active { color: var(--accent); }

.user-action-list {
  padding-inline: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-direction: row-reverse;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-6);
}
.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-6);
  background: var(--accent_12);
  color: var(--accent);
  font-weight: var(--fw-600);
  font-size: var(--fs-9);
  display: grid;
  place-items: center;
}
.header :is(.profile-title, .profile-subtitle) { font-size: var(--fs-9); line-height: 1.3; }
.header .profile-title { color: var(--onyx); font-weight: var(--fw-600); }
.header .profile-subtitle { color: var(--cool-gray); font-weight: var(--fw-500); }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid var(--line);
  color: var(--davys-gray);
  font-size: var(--fs-9);
  font-weight: var(--fw-500);
  transition: var(--transition);
}
.credit-pill .icon { font-size: 18px; color: var(--accent); }
.credit-pill:is(:hover, :focus-visible) { background: var(--black_08); }
.credit-value { font-weight: var(--fw-600); color: var(--onyx); }
.credit-pill.is-low { border-color: var(--coral); }
.credit-pill.is-low .credit-value { color: var(--coral); }
.credit-pill.is-error { border-color: var(--imperial-red); }
.credit-pill.is-error .credit-value, .credit-pill.is-error .icon { color: var(--imperial-red); }

/*-----------------------------------*\
  #LAYOUT
\*-----------------------------------*/

.article.container { padding: 20px 14px 40px; }
main { min-height: calc(100vh - 72px - 90px); }

.footer { background: var(--surface); padding-block: 22px; margin-top: 30px; }
.copyright { color: var(--davys-gray); font-size: var(--fs-9); line-height: 1.7; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--onyx);
  color: hsl(0, 0%, 100%);
  padding: 10px 18px;
  border-radius: var(--radius-6);
  font-size: var(--fs-8);
  box-shadow: var(--shadow-1);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 50;
  max-width: min(92vw, 520px);
}
:root[data-theme="dark"] .toast { background: hsl(210, 20%, 92%); color: hsl(214, 10%, 13%); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/*-----------------------------------*\
  #MEDIA QUERIES
\*-----------------------------------*/

@media (min-width: 570px) {
  .container { max-width: 550px; margin-inline: auto; }
  .navbar-list, .user-action-list { padding-inline: 0; }
}

@media (min-width: 768px) {
  .container { max-width: 700px; }
}

@media (min-width: 992px) {
  .container { max-width: 950px; }
  .menu-toggle-btn { display: none; }
  .header { height: unset; padding-block: 10px; overflow: visible; }
  .header.active { height: unset; }
  .navbar { all: unset; flex-grow: 1; }
  .navbar .container { display: flex; align-items: center; }
  .navbar-list {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-inline: auto;
  }
  .navbar-link { padding: 8px 10px; font-size: var(--fs-7); }
  .user-action-list { flex-direction: row; gap: 10px; flex-wrap: nowrap; }
  .article.container { padding-block: 35px 50px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1150px; }
  .navbar-list { gap: 14px; }
  .navbar-link { font-size: var(--fs-6); }
}
