@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&display=swap');

:root {
  --rw-bg: #eef4fb;
  --rw-surface: #ffffff;
  --rw-surface-2: #f7fbff;
  --rw-line: rgba(16, 56, 109, 0.14);
  --rw-line-strong: rgba(16, 56, 109, 0.22);
  --rw-tx: #0d2f54;
  --rw-tx-soft: #3f6589;
  --rw-primary: #1e56e8;
  --rw-primary-2: #1844bf;
  --rw-shadow: 0 18px 48px rgba(11, 42, 84, 0.12);
  --rw-shadow-soft: 0 12px 28px rgba(11, 42, 84, 0.09);
}

html,
body {
  color: var(--rw-tx);
  font-family: 'Manrope', 'DM Sans', system-ui, sans-serif;
  background:
    radial-gradient(980px 360px at 0% -10%, rgba(30, 86, 232, 0.12), transparent 64%),
    radial-gradient(860px 340px at 100% 0%, rgba(14, 165, 233, 0.09), transparent 58%),
    linear-gradient(180deg, #f8fbff 0%, var(--rw-bg) 100%);
}

.page {
  padding: 14px clamp(10px, 2.1vw, 22px) 52px;
}

.page::before {
  background:
    radial-gradient(1200px 520px at 14% -20%, rgba(30, 86, 232, 0.07), transparent 60%),
    radial-gradient(900px 480px at 100% -10%, rgba(14, 165, 233, 0.07), transparent 58%),
    linear-gradient(180deg, #f8fbff 0%, var(--rw-bg) 100%);
}

.shell {
  width: min(100%, 1900px);
  gap: 20px;
}

.top {
  top: 12px;
  border-radius: 18px;
  border: 1px solid var(--rw-line);
  border-bottom-color: var(--rw-line-strong);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--rw-shadow-soft);
  padding: 12px 16px;
}

.brand-name {
  font-family: 'Outfit', 'Syne', sans-serif;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--rw-tx);
}

.brand-name em {
  color: #5a7795;
  font-weight: 700;
}

.nav {
  gap: 8px;
}

.nav a {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #335a7f;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.nav a:hover {
  background: rgba(30, 86, 232, 0.09);
  border-color: rgba(30, 86, 232, 0.26);
  color: #164aa0;
}

.nav a.on {
  color: #ffffff;
  border-color: var(--rw-primary-2);
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2));
  box-shadow: 0 8px 18px rgba(30, 86, 232, 0.24);
}

.session-chip {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--rw-line);
  color: #43698d;
}

.profile-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--rw-line-strong);
  color: #355a80;
}

.profile-btn:hover {
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2));
  border-color: var(--rw-primary-2);
  color: #fff;
}

.profile-dd {
  border-color: var(--rw-line);
  box-shadow: var(--rw-shadow);
}

.card {
  border: 1px solid var(--rw-line);
  border-radius: 20px;
  border-bottom: 1px solid var(--rw-line-strong);
  padding: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(245, 251, 255, 0.92));
  box-shadow: var(--rw-shadow-soft);
}

.card-sm {
  border-radius: 16px;
  padding: 14px;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', 'Syne', sans-serif;
  color: #0c3158;
}

p,
.lead,
small {
  color: var(--rw-tx-soft);
}

.status {
  border-radius: 12px;
  border: 1px solid var(--rw-line);
  border-left: 0;
  background: rgba(255, 255, 255, 0.82);
  color: #3d6489;
  padding: 11px 13px;
}

.status.ok {
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
}

.status.warn {
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
}

.status.err {
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
}

.btn {
  border-radius: 12px;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-weight: 800;
}

.btn.main,
.btn.pro,
.btn.ok-btn,
.btn.danger {
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2));
  border-color: var(--rw-primary-2);
  color: #fff;
}

.btn.main:hover:not(:disabled),
.btn.pro:hover:not(:disabled),
.btn.ok-btn:hover:not(:disabled),
.btn.danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #1b4fd5, #123baf);
}

.btn.alt,
.btn.ghost {
  color: #1a4ca2;
  border-color: rgba(30, 86, 232, 0.32);
  background: rgba(30, 86, 232, 0.1);
}

.btn.alt:hover:not(:disabled),
.btn.ghost:hover:not(:disabled) {
  color: #103f8f;
  border-color: rgba(30, 86, 232, 0.46);
  background: rgba(30, 86, 232, 0.16);
}

input,
textarea,
select {
  border-radius: 12px;
  border-color: var(--rw-line);
  background: rgba(255, 255, 255, 0.93);
  color: #113a66;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(30, 86, 232, 0.55);
  box-shadow: 0 0 0 4px rgba(30, 86, 232, 0.15);
  background: #ffffff;
}

/* Home */
.landing-head {
  border: 1px solid var(--rw-line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--rw-shadow-soft);
}

.hero-grid {
  align-items: center;
  gap: 28px;
}

.overview-band {
  gap: 14px;
}

.overview-item {
  border: 1px solid var(--rw-line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(245, 251, 255, 0.92));
  box-shadow: var(--rw-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overview-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--rw-shadow);
}

/* Dashboard */
.panel-shell {
  gap: 20px;
}

.mission-card,
.pulse-card,
.metric-card,
.command-card,
.recent-card,
.health-card,
.workflow-card {
  border-color: var(--rw-line) !important;
  border-radius: 20px !important;
  box-shadow: var(--rw-shadow-soft) !important;
  background: linear-gradient(162deg, rgba(255, 255, 255, 0.97), rgba(244, 250, 255, 0.92)) !important;
}

.mission-headline h2,
.projects-head h2,
.ai-headline h1,
.ai-head h2,
.mk-title h2,
.mk-copy h1 {
  color: #0b2f53;
}

.mission-headline p,
.pulse-head p,
.project-kpi em,
.projects-head p,
.ai-head p,
.mk-title p,
.mk-copy p {
  color: #3f668b;
}

/* Projects */
.projects-wrap,
.project-list {
  gap: 14px;
}

.project-kpis {
  border-radius: 16px;
  border: 1px solid var(--rw-line);
  box-shadow: var(--rw-shadow-soft);
  overflow: hidden;
}

.project-card {
  border: 1px solid var(--rw-line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--rw-shadow-soft);
}

.project-card:hover {
  background: linear-gradient(90deg, rgba(30, 86, 232, 0.08), rgba(255, 255, 255, 0.9));
}

.project-thumb {
  border-radius: 12px;
}

/* Auth */
.auth-card {
  border-radius: 24px;
  border-color: var(--rw-line);
  background: linear-gradient(162deg, rgba(255, 255, 255, 0.98), rgba(242, 249, 255, 0.94));
  box-shadow: var(--rw-shadow);
}

.auth-main-title {
  font-family: 'Outfit', 'Syne', sans-serif;
  color: #0b2f53;
  letter-spacing: -0.02em;
}

.auth-main-sub,
.auth-status {
  color: #446b90;
}

/* AI intro + chat */
.ai-intro-main,
.ai-intro-side,
.ai-side-card,
.ai-main,
.ai-side .card,
.ai-signal,
.chat-thread {
  border-color: var(--rw-line) !important;
  box-shadow: var(--rw-shadow-soft);
}

.ai-intro-main,
.ai-main {
  border-radius: 20px !important;
}

.mode-btn.on,
.mode-tab.on {
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2)) !important;
  border-color: var(--rw-primary-2) !important;
}

/* Credits */
.credit-display,
.pack-card,
.custom-credit,
.cart-item,
.cart-totals,
.pay-method,
.order-box {
  border-color: var(--rw-line) !important;
  box-shadow: none;
}

.pack-card,
.custom-credit,
.cart-item,
.pay-method {
  background: rgba(255, 255, 255, 0.9) !important;
}

.pay-method.active {
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2)) !important;
  border-color: var(--rw-primary-2) !important;
}

/* Account */
.kv-row,
.switch-row,
.domain-item,
.payment-item,
.empty-box {
  border-color: var(--rw-line);
  background: rgba(255, 255, 255, 0.9);
}

/* Selection fields */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rw-primary);
}

.auth-legal-row,
.coupon-check,
.switch-row,
.check-row,
.accept-row,
.option-check,
.share-permission-card {
  border-color: rgba(30, 86, 232, 0.18) !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

.auth-legal-row:hover,
.coupon-check:hover,
.switch-row:hover,
.check-row:hover,
.accept-row:hover,
.option-check:hover,
.share-permission-card:hover {
  border-color: rgba(30, 86, 232, 0.38) !important;
  background: #ffffff !important;
  box-shadow: 0 14px 30px rgba(11, 42, 84, 0.08) !important;
}

.auth-legal-row:has(input:checked),
.coupon-check:has(input:checked),
.switch-row:has(input:checked),
.check-row:has(input:checked),
.accept-row:has(input:checked),
.option-check:has(input:checked),
.share-permission-card:has(input:checked),
.share-permission-card.selected {
  border-color: rgba(30, 86, 232, 0.6) !important;
  background: linear-gradient(180deg, rgba(30, 86, 232, 0.1), rgba(255, 255, 255, 0.98)) !important;
  box-shadow: 0 16px 38px rgba(30, 86, 232, 0.12) !important;
}

.auth-legal-row input,
.coupon-check input,
.switch-row input[type="checkbox"],
.check-row input[type="checkbox"],
.accept-row input,
.option-check input,
.share-permission-card input {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 auto;
}

/* Marketplace landing + zone + preview */
.mk-top,
.mk-main,
.mk-preview,
.mk-hero-main,
.mk-wallet,
.mk-filter-col,
.mk-market-col,
.mk-side-col .card,
.preview-top,
.preview-main,
.preview-thumb,
.preview-frame-wrap {
  border-color: var(--rw-line) !important;
  box-shadow: var(--rw-shadow-soft) !important;
}

.mk-nav a.on,
.mk-filter-chip.on {
  background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2)) !important;
  border-color: var(--rw-primary-2) !important;
}

.mk-list.market-grid {
  gap: 18px;
}

.mk-list.market-grid .tpl-item {
  border-color: var(--rw-line);
  box-shadow: var(--rw-shadow-soft);
}

.mk-list.market-grid .tpl-item:hover {
  box-shadow: var(--rw-shadow);
}

/* Footer */
.footer,
.bottom-note {
  color: #4a7195;
}
.footer a,
.bottom-note a {
  color: #155eef;
  font-weight: 900;
  text-decoration: none;
}
.footer a:hover,
.bottom-note a:hover {
  text-decoration: underline;
}

/* Responsive polish */
@media (max-width: 1080px) {
  .top {
    top: 8px;
    border-radius: 14px;
  }

  .nav {
    gap: 6px;
  }

  .nav a {
    padding: 0 10px;
  }
}

@media (max-width: 760px) {
  .card {
    border-radius: 16px;
    padding: 14px;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    min-height: 180px;
  }

  .mk-main,
  .mk-hero-main,
  .mk-wallet,
  .mk-filter-col,
  .mk-market-col,
  .preview-top,
  .preview-main {
    border-radius: 16px !important;
  }
}
