/* Amoura portal — bespoke design system (dark, animated, premium). */
:root {
  --bg: #04080e;
  --bg-2: #070d16;
  --surface: #0d1826;
  --surface-2: #122133;
  --line: #1f3147;
  --line-soft: #172536;
  --mint: #2ee6a8;
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --rose: #fb7185;
  --violet: #a78bfa;
  --text: #f3f8fd;
  --muted: #93a6bd;
  --faint: #64768c;
  --grad: linear-gradient(135deg, #2ee6a8 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(46, 230, 168, .16), rgba(34, 211, 238, .14));
  --glass: linear-gradient(162deg, rgba(20, 33, 51, .92), rgba(9, 16, 25, .92));
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .85);
  --radius: 20px;
  --radius-sm: 13px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(1000px 640px at -6% 8%, rgba(46, 230, 168, .10), transparent 58%),
    radial-gradient(900px 700px at 60% 112%, rgba(167, 139, 250, .08), transparent 60%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.03em; }
p { margin: 0; }
::selection { background: rgba(46, 230, 168, .3); }

/* Animated aurora backdrop */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .32; }
.aurora span:nth-child(1) { width: 52vw; height: 52vw; background: #2ee6a8; top: -18vw; left: -12vw; animation: drift1 24s ease-in-out infinite; }
.aurora span:nth-child(2) { width: 48vw; height: 48vw; background: #22d3ee; bottom: -20vw; right: -10vw; animation: drift2 28s ease-in-out infinite; }
.aurora span:nth-child(3) { width: 36vw; height: 36vw; background: #a78bfa; top: 30%; left: 40%; opacity: .16; animation: drift1 32s ease-in-out infinite reverse; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(7vw,5vh) scale(1.14); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-6vw,-7vh) scale(1.2); } }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; color: #02110d; font-weight: 900; font-size: 18px;
  box-shadow: 0 0 24px rgba(46, 230, 168, .55); animation: pulseGlow 3.6s ease-in-out infinite;
}
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 18px rgba(46,230,168,.4);} 50% { box-shadow: 0 0 34px rgba(46,230,168,.8);} }

/* ---------- Auth / guest ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--glass); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 26px; padding: 36px 32px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) both;
}
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.auth-card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(420px 160px at 50% -40%, rgba(46,230,168,.14), transparent 70%); pointer-events: none; }
.auth-card h1 { font-size: 27px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 266px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, rgba(10,18,28,.96), rgba(5,10,17,.98));
  border-right: 1px solid var(--line-soft); backdrop-filter: blur(12px);
  padding: 22px 15px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 6px 10px 18px; }
.nav-label { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 16px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: .18s; position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex: none; transition: .18s; }
.nav-item:hover { background: var(--surface); color: var(--text); transform: translateX(2px); }
.nav-item.active { background: var(--grad-soft); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(46,230,168,.18); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(46,230,168,.6)); }
.nav-item.active::before { content: ''; position: absolute; left: -15px; top: 50%; transform: translateY(-50%); width: 3px; height: 22px; background: var(--grad); border-radius: 3px; box-shadow: 0 0 10px rgba(46,230,168,.7); }
.sidebar-foot { margin-top: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 30px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0;
  background: rgba(5, 10, 16, .66); backdrop-filter: blur(16px); z-index: 20;
}
.topbar h2 { font-size: 20px; }
.content { padding: 28px 34px 52px; width: 100%; max-width: 1760px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  position: relative; transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s;
  animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both;
}
.card:hover { transform: translateY(-3px); border-color: rgba(46,230,168,.28); box-shadow: 0 30px 70px -28px rgba(0,0,0,.9), 0 0 0 1px rgba(46,230,168,.12), inset 0 1px 0 rgba(255,255,255,.05); }
.card.glow { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.card.glow::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); background: radial-gradient(360px 120px at 30% -30%, rgba(46,230,168,.16), transparent 70%); pointer-events: none; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 15px; display: flex; align-items: center; gap: 9px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Metric cards (premium stats) ---------- */
.metric {
  position: relative; overflow: hidden; padding: 22px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s;
  animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both;
}
.metric::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: .9; }
.metric:hover { transform: translateY(-5px); }
.metric .chip {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  margin-bottom: 18px; position: relative; z-index: 1;
}
.metric .chip svg { width: 23px; height: 23px; }
.metric-val { font-size: 34px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; position: relative; z-index: 1; }
.metric-lbl { color: var(--faint); font-size: 12.5px; font-weight: 600; margin-top: 8px; position: relative; z-index: 1; }
.metric .wm { position: absolute; right: -14px; bottom: -18px; width: 104px; height: 104px; opacity: .06; z-index: 0; }
.metric.mint::before   { background: var(--mint); }   .metric.mint .chip   { background: linear-gradient(135deg, #2ee6a8, #12b488); color: #02110d; box-shadow: 0 10px 26px -8px rgba(46,230,168,.65); } .metric.mint:hover   { border-color: rgba(46,230,168,.5);  box-shadow: 0 30px 66px -26px rgba(0,0,0,.9), 0 0 24px -4px rgba(46,230,168,.3); } .metric.mint .wm   { color: var(--mint); }
.metric.cyan::before   { background: var(--cyan); }   .metric.cyan .chip   { background: linear-gradient(135deg, #22d3ee, #0ea5c4); color: #021318; box-shadow: 0 10px 26px -8px rgba(34,211,238,.6); }  .metric.cyan:hover   { border-color: rgba(34,211,238,.5);  box-shadow: 0 30px 66px -26px rgba(0,0,0,.9), 0 0 24px -4px rgba(34,211,238,.3); } .metric.cyan .wm   { color: var(--cyan); }
.metric.violet::before { background: var(--violet); } .metric.violet .chip { background: linear-gradient(135deg, #a78bfa, #7c5cf0); color: #10061f; box-shadow: 0 10px 26px -8px rgba(167,139,250,.6); } .metric.violet:hover { border-color: rgba(167,139,250,.5); box-shadow: 0 30px 66px -26px rgba(0,0,0,.9), 0 0 24px -4px rgba(167,139,250,.3); } .metric.violet .wm { color: var(--violet); }
.metric.amber::before  { background: var(--amber); }  .metric.amber .chip  { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1200; box-shadow: 0 10px 26px -8px rgba(251,191,36,.6); }  .metric.amber:hover  { border-color: rgba(251,191,36,.5);  box-shadow: 0 30px 66px -26px rgba(0,0,0,.9), 0 0 24px -4px rgba(251,191,36,.3); }  .metric.amber .wm  { color: var(--amber); }
.metric.rose::before   { background: var(--rose); }   .metric.rose .chip   { background: linear-gradient(135deg, #fb7185, #e11d48); color: #1a020a; box-shadow: 0 10px 26px -8px rgba(251,113,133,.6); }  .metric.rose:hover   { border-color: rgba(251,113,133,.5);  box-shadow: 0 30px 66px -26px rgba(0,0,0,.9), 0 0 24px -4px rgba(251,113,133,.3); } .metric.rose .wm   { color: var(--rose); }

/* legacy .stat (used on landing) */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.stat .ic svg { width: 22px; height: 22px; }
.stat .val { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.stat .lbl { color: var(--faint); font-size: 12px; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 700;
  font-family: inherit; transition: .18s; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--grad); color: #02110d; box-shadow: 0 12px 28px -10px rgba(46, 230, 168, .75); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -10px rgba(46, 230, 168, .95); }
.btn-glass { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-glass:hover { border-color: var(--mint); color: var(--mint); box-shadow: 0 0 0 1px rgba(46,230,168,.2); }
.btn-danger { background: rgba(251, 113, 133, .12); color: var(--rose); border-color: rgba(251, 113, 133, .4); }
.btn-danger:hover { background: rgba(251, 113, 133, .2); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field-group { margin-bottom: 16px; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-size: 14px; font-family: inherit; transition: .18s;
}
.field:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(46, 230, 168, .16); }
.field::placeholder { color: var(--faint); }
textarea.field { resize: vertical; min-height: 84px; }
.err { color: var(--rose); font-size: 12px; margin-top: 6px; }
.hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--mint); }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.pill.good { background: rgba(46, 230, 168, .14); color: var(--mint); }
.pill.info { background: rgba(34, 211, 238, .14); color: var(--cyan); }
.pill.warn { background: rgba(251, 191, 36, .14); color: var(--amber); }
.pill.bad { background: rgba(251, 113, 133, .14); color: var(--rose); }
.pill.mute { background: var(--surface-2); color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--faint); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: .14s; }
.tbl tbody tr:hover { background: rgba(46, 230, 168, .035); }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; }

/* ---------- Misc ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.flash { padding: 13px 16px; border-radius: 13px; margin-bottom: 18px; font-size: 13.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; animation: fadeUp .4s both; }
.flash.ok { background: rgba(46, 230, 168, .1); border: 1px solid rgba(46, 230, 168, .3); color: var(--mint); }
.flash.bad { background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .3); color: var(--rose); }
.key-reveal { font-family: 'JetBrains Mono', monospace; font-size: 15px; letter-spacing: .04em; background: var(--bg-2); border: 1px dashed var(--mint); border-radius: 12px; padding: 14px 16px; color: var(--mint); word-break: break-all; }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--grad); color: #02110d; display: grid; place-items: center; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px -6px rgba(46,230,168,.6); }
.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty svg { width: 40px; height: 40px; opacity: .45; margin-bottom: 12px; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-tabs { display: inline-flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.chip-tabs a { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; }
.chip-tabs a:hover { color: var(--text); }
.chip-tabs a.on { background: var(--grad-soft); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(46,230,168,.2); }

/* glance rows with accent */
.glance-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.glance-row:last-child { border-bottom: none; }
.glance-row .k { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.glance-row .k .d { width: 8px; height: 8px; border-radius: 50%; }
.glance-row .v { font-weight: 800; font-size: 16px; }

/* Plan cards */
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--glass); transition: .2s; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.plan::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: 0; transition: .2s; }
.plan:hover { transform: translateY(-5px); border-color: rgba(46, 230, 168, .4); }
.plan:hover::before { opacity: 1; }
.plan .price { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; margin: 8px 0; }
.plan .price small { font-size: 13px; color: var(--faint); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 9px; }
.plan li { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 13px; }
.plan li svg { width: 16px; height: 16px; color: var(--mint); flex: none; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(2, 6, 12, .72); backdrop-filter: blur(7px); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s both; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); animation: fadeUp .3s both; max-height: 90vh; overflow-y: auto; }

.fade-up { animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: .06s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .18s; } .d4 { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.menu-btn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 266px; transform: translateX(-110%); transition: .25s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
