/* ==========================================================================
   LOGINPAGE 24 - macOS DEV WINDOW (IDE Sidebar + Terminal Workspace)
   ========================================================================== */
:root {
  --bg-desk: #090c10;
  --win-bg: #161b22;
  --win-side: #0f1318;
  --win-bar: #1f242d;
  --win-input: #0d1117;
  --border: #30363d;
  --blue: #58a6ff;
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
  --ink: #e6edf3;
  --sub: #8b949e;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-desk);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(88, 166, 255, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 82% 85%, rgba(63, 185, 80, 0.12) 0%, transparent 45%);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#app-loader {
  position: fixed; inset: 0; z-index: 9999; background: var(--bg-desk);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: opacity 0.3s, visibility 0.3s;
}
#app-loader.fade-out { opacity: 0; visibility: hidden; }
.mac-spinner {
  width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mac-shell { width: 100%; max-width: 760px; margin: 0 auto; }
.mac-shell.centered { max-width: 440px; }

.mac-window {
  background: var(--win-bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7); overflow: hidden;
}
.mac-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; background: var(--win-bar); border-bottom: 1px solid var(--border);
}
.mac-lights { display: flex; align-items: center; gap: 7px; }
.mac-dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f56; } .dot-y { background: #ffbd2e; } .dot-g { background: #27c93f; }
.mac-win-title { font-family: var(--font-mono); font-size: 11.5px; color: var(--sub); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* IDE Split Workspace */
.ide-body { display: flex; flex-direction: column; min-height: 440px; }
@media (min-width: 680px) { .ide-body { flex-direction: row; } }

.ide-sidebar {
  background: var(--win-side); border-bottom: 1px solid var(--border); padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
@media (min-width: 680px) {
  .ide-sidebar { width: 220px; border-bottom: none; border-right: 1px solid var(--border); flex-shrink: 0; padding: 16px 12px; }
}
.ide-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 680px) { .ide-nav { display: flex; flex-direction: column; gap: 4px; } }
.ide-nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--sub); cursor: pointer;
}
@media (min-width: 680px) { .ide-nav-btn { justify-content: flex-start; } }
.ide-nav-btn.active { background: rgba(88, 166, 255, 0.12); border-color: rgba(88, 166, 255, 0.35); color: var(--ink); }
.ide-nav-btn.active i { color: var(--blue); }

.ide-main { flex: 1; padding: 20px; overflow-y: auto; }
.ide-pane { display: none; }
.ide-pane.active { display: block; }

.mac-brand-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.mac-brand-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mac-logo {
  width: 36px; height: 36px; border-radius: 8px; background: var(--win-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mac-logo img { width: 22px; height: 22px; object-fit: contain; }
.mac-title { font-family: var(--font-mono); font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mac-sub { font-size: 11px; color: var(--sub); }
.mac-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 3px 9px;
  border-radius: 9999px; background: rgba(63, 185, 80, 0.14); border: 1px solid rgba(63, 185, 80, 0.35); color: var(--green);
}

.mac-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px;
  background: var(--win-input); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px;
}
.mac-tab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border: none; border-radius: 7px; background: transparent;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.mac-tab-btn.active { background: var(--win-bar); color: var(--ink); border: 1px solid var(--border); }
.mac-tab-btn.active i { color: var(--blue); }

.mac-field { margin-bottom: 12px; }
.mac-label { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--sub); margin-bottom: 6px; }
.mac-input-wrap { position: relative; display: flex; align-items: center; }
.mac-prompt { position: absolute; left: 13px; font-family: var(--font-mono); font-size: 13px; color: var(--green); font-weight: 700; pointer-events: none; }
.mac-input {
  width: 100%; height: 44px; padding: 0 40px 0 34px; border-radius: 8px;
  background: var(--win-input); border: 1px solid var(--border); color: var(--ink);
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; outline: none;
}
.mac-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18); }
.mac-eye-btn { position: absolute; right: 10px; background: none; border: none; color: var(--sub); cursor: pointer; padding: 6px; }

.btn-mac-primary {
  width: 100%; height: 44px; border: none; border-radius: 8px; background: #238636; color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-mac-primary:hover { background: #2ea043; }
.btn-mac-secondary {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--win-input); color: var(--ink);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-mac-danger {
  width: 100%; height: 42px; border: 1px solid rgba(248, 81, 73, 0.4); border-radius: 8px;
  background: rgba(248, 81, 73, 0.14); color: #ffa198; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.mac-scanner { background: var(--win-input); border: 1px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; margin-bottom: 12px; }
.mac-viewfinder {
  position: relative; width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 12px;
  background: rgba(88, 166, 255, 0.12); border: 1px solid rgba(88, 166, 255, 0.35);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 24px; overflow: hidden;
}
.mac-laser { position: absolute; left: 6px; right: 6px; height: 2px; background: var(--blue); animation: scanLine 2s infinite; }
@keyframes scanLine { 0%, 100% { top: 8px; } 50% { top: 50px; } }

.mac-error {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px;
  border-radius: 8px; background: rgba(248, 81, 73, 0.14); border: 1px solid rgba(248, 81, 73, 0.4); color: #ffa198; font-size: 12px; font-weight: 600;
}
.mac-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); }
.mac-divider::before, .mac-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.mac-terminal-meta {
  padding: 10px 12px; background: var(--win-input); border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); line-height: 1.7;
}
.mac-pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 440px) { .mac-pkg-grid { grid-template-columns: 1fr; } }
.mac-pkg-card { background: var(--win-input); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.mac-pkg-card.popular { border-color: var(--blue); }
.mac-pkg-badge { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(88,166,255,0.14); color: var(--blue); display: inline-block; width: fit-content; }

.mac-faq-item { background: var(--win-input); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.mac-faq-btn { width: 100%; background: none; border: none; padding: 11px 14px; color: var(--ink); font-family: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mac-faq-item.open .mac-faq-btn i { transform: rotate(180deg); color: var(--blue); }
.mac-faq-ans { display: none; padding: 0 14px 12px; font-size: 11.5px; color: var(--sub); }
.mac-faq-item.open .mac-faq-ans { display: block; }

.mac-win-body { padding: 20px; }
.wa-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 48px; height: 48px; border-radius: 50%;
  background: #238636; color: #fff; border: 1px solid var(--border); box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
}
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(9,12,16,0.8); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal-mac { width: 100%; max-width: 360px; background: var(--win-bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.qris-white { background: #fff; color: #090c10; border-radius: 10px; padding: 12px; text-align: center; margin: 12px 0; }
.qris-white img { width: 145px; height: 145px; object-fit: contain; margin: 6px auto; display: block; }
