/* ================================================================
   SITES.CSS - label situs, app switcher, Hub, Intro Tools,
   Humanizer & Grammar. Memakai token warna dari index.html/landing.css.
   ================================================================ */

/* ---------- Label subdomain di samping logo ---------- */
.site-tag {
  margin-left: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(217, 161, 59, .18);
  color: var(--gold);
  font-family: "Inter", sans-serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.site-tag:empty { display: none; }
#siteNav.public-nav .site-tag { background: #edf5ff; color: var(--landing-blue); }

/* ---------- App switcher ---------- */
.app-switch { position: relative; flex: 0 0 auto; margin-left: 12px; }
.app-switch + .lang-switch { margin-left: 8px; }
.app-switch summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--navy-soft);
  color: #c8d4e4;
  font-size: .82rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.app-switch summary::-webkit-details-marker { display: none; }
.app-switch summary::before {
  content: "";
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 0 / 4px 4px;
}
.app-switch summary:hover, .app-switch details[open] summary { color: #fff; }
.app-switch summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#siteNav.public-nav .app-switch summary { background: #eef3f9; color: #536981; }
#siteNav.public-nav .app-switch summary:hover,
#siteNav.public-nav .app-switch details[open] summary { color: var(--landing-ink); }

/* Nav aplikasi memakai overflow-x:auto, jadi menu dibuat fixed agar tidak terpotong */
.app-switch-menu {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 50;
  width: min(270px, calc(100vw - 32px));
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(16, 35, 59, .16);
}
#siteNav.public-nav .app-switch-menu { position: absolute; top: calc(100% + 10px); right: 0; }
.app-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--navy);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}
.app-switch-item:hover { background: var(--sky); }
.app-switch-item.aktif { background: #f5f8fb; box-shadow: inset 0 0 0 1px var(--line); }
.app-switch-icon, .hub-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.app-switch-icon { width: 36px; height: 28px; }

/* ---------- Hub (engbreaker.com) & Intro Tools ---------- */
#halamanHub, #halamanIntro { background: #fff; color: var(--landing-ink); }
.hub-hero {
  padding: 72px 0 36px;
  background: radial-gradient(circle at 85% 0%, #e8f1ff 0, transparent 45%), radial-gradient(circle at 0% 100%, var(--landing-mint) 0, transparent 40%);
}
.hub-hero h1, .intro-wrap h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.03;
  letter-spacing: -.04em;
}
.hub-hero h1 span, .intro-wrap h1 span { display: block; color: var(--landing-blue); }
.hub-lead { max-width: 640px; color: #536981; font-size: 1.04rem; line-height: 1.75; }
.hub-greeting { margin-top: 22px; font-weight: 650; }
.hub-greeting:empty, #hubActions[hidden] { display: none; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  padding: 12px 0 64px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hub-card:hover { border-color: #aebfd2; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(16, 35, 59, .08); }
.hub-card:focus-visible { outline: 2px solid var(--landing-blue); outline-offset: 3px; }
.hub-card-icon { width: 46px; height: 38px; background: var(--landing-blue); font-size: .68rem; }
.hub-card h2 { font-family: "Fraunces", serif; font-size: 1.2rem; }
.hub-card p { flex: 1; color: #536981; font-size: .9rem; line-height: 1.6; }
.hub-card-link { color: var(--landing-blue); font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.hub-footer { padding: 24px 16px 40px; border-top: 1px solid #eef2f7; color: #60748a; font-size: .82rem; text-align: center; }

.intro-wrap { max-width: 780px; padding: 72px 0 88px; }
.intro-list { display: grid; gap: 10px; margin-top: 26px; padding: 0; list-style: none; }
.intro-list li { display: flex; gap: 10px; align-items: baseline; color: #334a63; font-weight: 600; }
.intro-list li::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: #23a47b; transform: translateY(-1px); }

a.feature-link { text-decoration: none; }
a.feature-link:hover { text-decoration: underline; }

/* ---------- Humanizer & Grammar ---------- */
#halamanHumanizer .ai-mode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.char-count.lewat { color: var(--red); font-weight: 700; }
#grOutput { min-height: 170px; }

.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #f1d9a6;
  border-radius: 12px;
  background: var(--landing-cream);
}
.upgrade-banner[hidden] { display: none; }
.upgrade-banner p { margin-top: 3px; color: var(--muted); font-size: .85rem; }

.gr-summary { margin-top: 12px; font-size: .88rem; font-weight: 700; }
.gr-summary.bersih { color: var(--teal); }
.gr-summary:empty { display: none; }
.gr-issues { display: grid; gap: 8px; max-height: 340px; margin-top: 8px; padding: 0; overflow: auto; list-style: none; }
.gr-issue { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.gr-change { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.gr-change span { color: var(--muted); }
.gr-change del { padding: 0 4px; border-radius: 4px; background: #fdecec; color: var(--red); }
.gr-change ins { padding: 0 4px; border-radius: 4px; background: #e8f5ee; color: #1c6b43; font-weight: 600; text-decoration: none; }
.gr-type { display: inline-block; margin-top: 6px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.gr-issue p { margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.5; }

@media (max-width: 640px) {
  .hub-hero { padding: 44px 0 24px; }
  .intro-wrap { padding: 44px 0 60px; }
  #halamanHumanizer .ai-mode { grid-template-columns: 1fr; }
  .upgrade-banner { flex-direction: column; align-items: stretch; }
  .app-switch summary { padding: 6px 8px; font-size: 0; gap: 0; }
  .app-switch summary::before { width: 14px; height: 14px; }
  .app-switch-menu { right: 8px; }
}

/* Nav IELTS publik: sembunyikan tautan seksi saat sempit agar Sign in, Start free, Apps muat */
@media (max-width: 960px) {
  #siteNav .public-links { display: none !important; }
}

/* Layar sangat sempit: label subdomain disembunyikan (judul halaman sudah menyebutnya) */
@media (max-width: 440px) {
  .site-tag { display: none; }
}

/* ---------- Tombol "Continue with Google" (mengikuti pedoman merek Google) ---------- */
.google-login[hidden] { display: none; }
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #dadce0;
  border-radius: 10px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-google:hover { background: #f8faff; box-shadow: 0 1px 3px rgba(60, 64, 67, .18); }
.btn-google:focus-visible { outline: 2px solid var(--landing-blue); outline-offset: 2px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Kelola akun: edit langsung di tabel ---------- */
.acct-row td { vertical-align: middle; }
.acct-row.berubah { background: #f5f9ff; box-shadow: inset 3px 0 0 var(--accent, #175cd3); }
.acct-nama {
  width: min(260px, 100%); padding: 3px 6px; margin-left: -6px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--navy); font: inherit; font-weight: 700;
}
.acct-nama:hover { border-color: var(--line); }
.acct-nama:focus { border-color: var(--accent, #175cd3); background: #fff; outline: none; }
.acct-email { display: block; color: var(--muted); }
.acct-minta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 2px; }
.acct-approve {
  padding: 3px 9px; border: 1px solid var(--accent, #175cd3); border-radius: 999px;
  background: #fff; color: var(--accent, #175cd3); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer;
}
.acct-approve:hover { background: var(--accent-soft, #edf5ff); }
.acct-role { width: auto; padding: 6px 8px; border-radius: 8px; font-size: .82rem; font-weight: 700; }
.acct-role.role-admin { background: #f3e8cf; color: #8a6210; border-color: #ead7a8; }
.acct-role.role-premium { background: #e2f3ee; color: var(--teal); border-color: #bfe3d7; }
.acct-kredit { width: 84px; padding: 6px 8px; }
.acct-kredit[hidden], .acct-tak-terbatas[hidden] { display: none; }
.acct-tak-terbatas { font-size: 1.1rem; color: var(--muted); }

/* Sakelar aktif / nonaktif */
.acct-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; font-size: .8rem; font-weight: 600; color: var(--navy-soft); }
.acct-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.acct-slider { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 999px; background: #cfd8e3; transition: background .15s; }
.acct-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.acct-switch input:checked + .acct-slider { background: var(--teal); }
.acct-switch input:checked + .acct-slider::after { transform: translateX(16px); }
.acct-switch input:focus-visible + .acct-slider { outline: 2px solid var(--accent, #175cd3); outline-offset: 2px; }

.acct-save:not(:disabled) { background: var(--accent, #175cd3); border-color: var(--accent, #175cd3); color: #fff; }
.acct-save:disabled { opacity: .45; cursor: default; }
.acct-cancel[hidden] { display: none; }

/* ---------- Dialog konfirmasi / isian (dialog.js) ---------- */
.eb-dialog {
  width: min(440px, calc(100vw - 24px)); margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: 16px; color: var(--navy);
  box-shadow: 0 30px 70px rgba(16, 35, 59, .25);
}
.eb-dialog::backdrop { background: rgba(16, 35, 59, .45); }
.eb-dialog-isi { display: grid; gap: 10px; padding: 22px 22px 18px; }
.eb-dialog-judul { font-family: "Fraunces", serif; font-size: 1.2rem; line-height: 1.3; overflow-wrap: anywhere; }
.eb-dialog-pesan { color: var(--navy-soft); font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.eb-dialog-label { margin: 2px 0 -4px; }
.eb-dialog-input { width: 100%; }
.eb-dialog-aksi { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.eb-dialog-aksi .btn { min-width: 90px; }
.eb-dialog-aksi .btn:disabled { opacity: .5; cursor: default; }
.btn.eb-bahaya { background: var(--red); box-shadow: none; }
.btn.eb-bahaya:hover { background: #962f1f; }
[hidden].eb-dialog-judul, [hidden].eb-dialog-pesan, [hidden].eb-dialog-label, [hidden].eb-dialog-input, .eb-dialog-aksi [hidden] { display: none; }
