/* =========================================================================
   febryfadly.my.id — AI Workspace
   Tema gelap futuristik + glassmorphism. Dipakai oleh semua halaman.
   ========================================================================= */

:root {
  /* Warna dasar */
  --bg:           #05070f;
  --bg-2:         #0a0e1c;
  --panel:        rgba(255, 255, 255, 0.045);
  --panel-2:      rgba(255, 255, 255, 0.07);
  --border:       rgba(255, 255, 255, 0.09);
  --border-2:     rgba(255, 255, 255, 0.18);
  --text:         #eaf0fb;
  --muted:        #9aa6bf;
  --muted-2:      #67728c;

  /* Warna brand / aksen */
  --brand-1:      #7c5cff;   /* ungu  */
  --brand-2:      #22d3ee;   /* cyan  */
  --brand-3:      #c05cff;   /* pink-ungu */
  --grad:         linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --grad-soft:    linear-gradient(135deg, rgba(124,92,255,.18), rgba(34,211,238,.18));

  --danger:       #ff5d6c;
  --ok:           #38e0a0;

  --radius:       18px;
  --radius-sm:    12px;
  --shadow:       0 24px 70px rgba(0, 0, 0, .55);
  --shadow-glow:  0 0 0 1px rgba(124,92,255,.25), 0 18px 50px rgba(34,211,238,.10);

  --font:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-dis:'Space Grotesk', var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;
  position: relative;
}

/* --- Latar belakang "aurora" yang bergerak halus --- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  pointer-events: none;
}
body::before {
  width: 60vw; height: 60vw;
  top: -18vw; left: -12vw;
  background: radial-gradient(circle at center, rgba(124,92,255,.85), transparent 62%);
  animation: float1 18s ease-in-out infinite;
}
body::after {
  width: 55vw; height: 55vw;
  bottom: -20vw; right: -14vw;
  background: radial-gradient(circle at center, rgba(34,211,238,.7), transparent 62%);
  animation: float2 22s ease-in-out infinite;
}
/* Lapisan grid tipis agar terasa "techy" */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.013) 1px, transparent 1px);
  background-size: 64px 64px;
  /* Lebih samar & cepat memudar, supaya tidak mengganggu mata di area konten */
  mask-image: radial-gradient(ellipse 70% 55% at 50% 28%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 28%, #000 0%, transparent 72%);
}

@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(6vw, 5vh) scale(1.12); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-5vw, -6vh) scale(1.15); }
}

/* ========================= Komponen umum ========================= */

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* Logo orb (bola bercahaya) */
.orb {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 8px 26px rgba(124,92,255,.5), inset 0 0 14px rgba(255,255,255,.35);
  position: relative; flex: none;
}
.orb svg { width: 24px; height: 24px; }
.orb.lg { width: 70px; height: 70px; border-radius: 22px; }
.orb.lg svg { width: 38px; height: 38px; }
.orb::after {
  content:""; position:absolute; inset:-6px; border-radius:inherit;
  background: var(--grad); filter: blur(16px); opacity:.55; z-index:-1;
}

.wordmark { font-family: var(--font-dis); font-weight: 700; letter-spacing: -.3px; }
.brandname { font-size: 1.15rem; line-height: 1.1; }
.brandname b {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brandsub { font-size: .72rem; color: var(--muted-2); letter-spacing: 2px; text-transform: uppercase; }

/* Kartu kaca */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

/* Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font); font-size: .97rem; font-weight: 600;
  padding: 13px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: transform .15s ease, box-shadow .25s ease, background .2s ease;
  width: 100%;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--grad); border: none; color: #06121f; font-weight: 700;
  box-shadow: 0 10px 30px rgba(34,211,238,.28), 0 6px 20px rgba(124,92,255,.32);
}
.btn-primary:hover { box-shadow: 0 16px 44px rgba(34,211,238,.42), 0 10px 28px rgba(124,92,255,.45); }
.btn svg { width: 18px; height: 18px; }

/* ========================= Halaman Login / Setup ========================= */

.auth-wrap {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 28px 18px;
}
.auth-card {
  width: 100%; max-width: 430px;
  padding: 38px 34px 30px;
  box-shadow: var(--shadow);
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .orb.lg { margin: 0 auto 18px; }
.auth-title { font-family: var(--font-dis); font-size: 1.6rem; font-weight: 700; letter-spacing: -.5px; }
.auth-sub { color: var(--muted); font-size: .94rem; margin-top: 6px; }

.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell > svg.lead { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted-2); }
.input {
  width: 100%; font-family: var(--font); font-size: .98rem; color: var(--text);
  background: rgba(0,0,0,.28); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px 13px 42px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus {
  outline: none; border-color: rgba(124,92,255,.65);
  box-shadow: 0 0 0 4px rgba(124,92,255,.16);
  background: rgba(0,0,0,.34);
}
.toggle-eye {
  position: absolute; right: 8px; background: none; border: none; cursor: pointer;
  color: var(--muted-2); padding: 8px; display: grid; place-items: center; border-radius: 8px;
}
.toggle-eye:hover { color: var(--text); }
.toggle-eye svg { width: 19px; height: 19px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .88rem; color: var(--muted); user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border-2);
  background: rgba(0,0,0,.3); display: grid; place-items: center; transition: .2s; flex: none;
}
.check .box svg { width: 13px; height: 13px; opacity: 0; transform: scale(.5); transition: .2s; color: #06121f; }
.check input:checked + .box { background: var(--grad); border-color: transparent; }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(124,92,255,.18); }

.hint-link { font-size: .85rem; color: var(--brand-2); }

.auth-foot { text-align: center; margin-top: 22px; font-size: .8rem; color: var(--muted-2);
  display: flex; align-items: center; justify-content: center; gap: 7px; }
.auth-foot svg { width: 14px; height: 14px; color: var(--ok); }

/* Pesan error / info */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem;
  margin-bottom: 18px; border: 1px solid;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-error { background: rgba(255,93,108,.1); border-color: rgba(255,93,108,.35); color: #ffb3bb; }
.alert-info  { background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.28); color: #aef0fa; }
.alert-ok    { background: rgba(56,224,160,.08); border-color: rgba(56,224,160,.3); color: #b6f4da; }

/* Indikator kekuatan password (setup) */
.pw-meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 9px; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .25s ease, background .25s ease; }
.pw-note { font-size: .76rem; color: var(--muted-2); margin-top: 6px; }

/* ========================= Dashboard ========================= */

.topbar {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(7,10,20,.6);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand-row { display: flex; align-items: center; gap: 12px; }

.top-actions { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted);
  padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(56,224,160,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(56,224,160,.55);} 70%{box-shadow:0 0 0 8px rgba(56,224,160,0);} 100%{box-shadow:0 0 0 0 rgba(56,224,160,0);} }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer; transition: .2s; }
.user-chip:hover { border-color: var(--border-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; color: #06121f; flex: none; }
.user-chip .nm { font-size: .88rem; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip svg { width: 16px; height: 16px; color: var(--muted-2); }

.btn-ghost { width: auto; padding: 9px 14px; font-size: .86rem; }
.btn-icon { width: auto; padding: 10px; }

/* Hero */
.hero { padding: 54px 0 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--brand-2); padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(34,211,238,.25); background: rgba(34,211,238,.06); margin-bottom: 18px; }
.eyebrow .dot { background: var(--brand-2); }
.hero h1 { font-family: var(--font-dis); font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 700; letter-spacing: -1px; line-height: 1.08; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { color: var(--muted); font-size: 1.05rem; margin-top: 14px; max-width: 560px; }

/* Command bar (placeholder chat AI) */
.cmd {
  margin-top: 30px; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 18px; border-radius: 16px; max-width: 720px;
  border: 1px solid var(--border-2); background: rgba(13, 18, 34, .62); cursor: text;
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow-glow);
}
.cmd svg.spark { width: 22px; height: 22px; color: var(--brand-2); flex: none; }
.cmd input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--font); font-size: 1rem; }
.cmd input::placeholder { color: var(--muted-2); }
.cmd .go { width: auto; padding: 11px 16px; flex: none; }

/* Grid kartu fitur */
.section-label { display: flex; align-items: center; gap: 12px; margin: 46px 0 18px; color: var(--muted); font-size: .82rem; letter-spacing: 1.5px; text-transform: uppercase; }
.section-label::after { content:""; height: 1px; flex: 1; background: var(--border); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  position: relative; padding: 22px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  /* panel solid + kaca buram -> garis latar tidak menembus, tulisan lebih nyaman */
  background: rgba(13, 18, 34, .66);
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.card::before {
  content:""; position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease;
  background: var(--grad-soft); z-index: 0;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card .ico {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 15px;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand-2);
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { font-family: var(--font-dis); font-size: 1.08rem; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 9px; }
.card p { color: var(--muted); font-size: .9rem; }
.badge {
  font-size: .66rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; color: var(--brand-2);
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3);
}
.badge.gray { color: var(--muted-2); background: rgba(255,255,255,.05); border-color: var(--border); }

.foot { text-align: center; color: var(--muted-2); font-size: .8rem; padding: 50px 0 34px; }
.foot b { color: var(--muted); }

/* Halaman Pengaturan / Akun */
.page { padding: 34px 0 50px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.panel { padding: 22px; margin-bottom: 16px; max-width: 760px; }
.panel h2 { font-family: var(--font-dis); font-size: 1.12rem; font-weight: 600; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: .9rem; margin-bottom: 16px; max-width: 60ch; }
.btn.inline { width: auto; }
.codebox {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem); font-weight: 600; letter-spacing: 3px;
  background: rgba(0,0,0,.4); border: 1px dashed var(--border-2); border-radius: 12px;
  padding: 18px 14px; text-align: center; color: #aef0fa; word-break: break-word; margin-bottom: 8px;
  user-select: all;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(12,16,28,.92); border: 1px solid var(--border-2); color: var(--text);
  padding: 13px 18px; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 100; backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; color: var(--brand-2); }

/* Animasi */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.d1{animation-delay:.05s}.d2{animation-delay:.12s}.d3{animation-delay:.19s}
.d4{animation-delay:.26s}.d5{animation-delay:.33s}.d6{animation-delay:.4s}

/* ========================= Responsif (HP) ========================= */
@media (max-width: 640px) {
  .auth-card { padding: 30px 22px 24px; }
  .topbar .inner { height: 60px; }
  .user-chip .nm { display: none; }
  .status-pill .txt { display: none; }
  .hero { padding: 38px 0 20px; }
  .cmd { flex-wrap: wrap; padding: 14px; }
  .cmd input { width: 100%; padding: 4px 0; }
  .cmd .go { width: 100%; }
  .cards { grid-template-columns: 1fr; }
}

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