/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e; background: #f8f9fa; line-height: 1.6; min-height: 100vh;
}
a { color: #1976d2; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #e8eaf6; padding: 2px 8px; border-radius: 4px; font-size: 13px; word-break: break-all; }

/* ── Layout ── */
#app { min-height: 100vh; }
.public-page { display: flex; flex-direction: column; min-height: 100vh; }
.public-page > .site-footer { margin-top: auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-pad { padding-top: 32px; padding-bottom: 48px; }

/* ── Navbar ── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-size: 20px; font-weight: 700; color: #1976d2; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { font-size: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 8px 20px; border-radius: 6px; font-weight: 600;
  font-size: 14px; border: 2px solid transparent; cursor: pointer; text-align: center;
  text-decoration: none; transition: all .15s;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary { background: #1976d2; color: #fff; border-color: #1976d2; }
.btn-primary:hover { background: #1565c0; }
.btn-outline { background: transparent; color: #1976d2; border-color: #1976d2; }
.btn-outline:hover { background: #e3f2fd; }
.btn-sm { padding: 4px 14px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Lang Switch ── */
.lang-switch { display: inline-flex; gap: 2px; }
.lang-btn {
  padding: 3px 10px; font-size: 12px; font-weight: 600; border: 1px solid #ccc;
  background: #fff; cursor: pointer; border-radius: 4px; transition: all .15s;
}
.lang-btn.active { background: #1976d2; color: #fff; border-color: #1976d2; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1976d2, #0d47a1); color: #fff;
  padding: 100px 20px 80px; text-align: center;
}
.hero h1 { font-size: 42px; margin-bottom: 16px; font-weight: 800; }
.hero-sub { font-size: 18px; opacity: .9; max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); }

/* ── Sections ── */
.section { padding: 64px 20px; }
.section-alt { background: #fff; }
.section-title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 40px; }

/* ── Steps ── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step-card {
  background: #fff; border-radius: 12px; padding: 32px 24px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.step-num {
  width: 48px; height: 48px; border-radius: 50%; background: #1976d2; color: #fff;
  font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step-card h3 { margin-bottom: 8px; }

/* ── Features ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card {
  background: #f8f9fa; border-radius: 12px; padding: 28px 24px;
  border: 1px solid #e0e0e0;
}
.feature-card h3 { margin-bottom: 8px; color: #1976d2; }

/* ── FAQ ── */
.faq { max-width: 700px; margin: 0 auto; }
.faq-item {
  border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 12px;
  background: #fff; overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '+ '; color: #1976d2; font-weight: 700; }
.faq-item[open] summary::before { content: '- '; }
.faq-item p { padding: 0 20px 16px; color: #555; }

/* ── CTA ── */
.cta-section {
  background: linear-gradient(135deg, #1976d2, #0d47a1); color: #fff;
  padding: 64px 20px; text-align: center;
}
.cta-section h2 { font-size: 28px; margin-bottom: 12px; }
.cta-section p { margin-bottom: 24px; opacity: .9; }

/* ── Footer ── */
.site-footer { padding: 24px 20px; text-align: center; color: #888; font-size: 14px; background: #fff; border-top: 1px solid #eee; }

/* ── Auth ── */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 120px); padding: 40px 20px; }
.auth-card {
  background: #fff; border-radius: 12px; padding: 40px 32px; width: 100%; max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.auth-card h2 { text-align: center; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: #666; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 15px; transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,.15); }
.form-select {
  padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
  background: #fff; cursor: pointer;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fde8e8; color: #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; }

/* ── Cabinet Layout ── */
.cabinet { display: flex; min-height: 100vh; }
.cabinet-sidebar {
  width: 260px; background: #fff; border-right: 1px solid #e0e0e0; display: flex;
  flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid #eee; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }
.sidebar-link {
  display: block; padding: 10px 16px; border-radius: 6px; color: #333; font-weight: 500;
  font-size: 14px; margin-bottom: 4px; text-decoration: none; transition: background .15s;
}
.sidebar-link:hover { background: #f5f5f5; text-decoration: none; }
.sidebar-link.active { background: #e3f2fd; color: #1976d2; font-weight: 600; }
.sidebar-footer { border-top: 1px solid #eee; padding: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #1976d2; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
}
.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cabinet-main { flex: 1; margin-left: 260px; padding: 32px; }

/* ── Cards ── */
.card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* ── Services Grid ── */
.filter-bar { margin-bottom: 20px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.service-card {
  background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
}
.service-cat {
  display: inline-block; background: #e3f2fd; color: #1976d2; padding: 2px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 600; margin-bottom: 8px; align-self: flex-start;
}
.service-card h3 { margin-bottom: 8px; font-size: 16px; }
.service-desc { font-size: 13px; color: #666; margin-bottom: 12px; }
.service-meta { display: flex; justify-content: space-between; font-size: 13px; color: #555; margin-bottom: 16px; margin-top: auto; }
.service-card .btn { align-self: flex-start; }

/* ── Data Table ── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.data-table th { background: #f5f5f5; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 10px 16px; border-top: 1px solid #eee; font-size: 14px; }
.data-table .mono { font-family: monospace; font-size: 12px; }
.data-table .link-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px;
  font-weight: 600; color: #fff;
}

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }

/* ── Page header ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

/* ── Profile ── */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.profile-grid .card h3 { margin-bottom: 16px; }
.info-row { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.info-row .btn-sm { margin-left: 8px; vertical-align: middle; }
.api-key-hint { color: #777; font-size: 13px; }

/* ── Deposit ── */
.deposit-card { max-width: 520px; }
.balance-display { display: flex; justify-content: space-between; align-items: baseline; padding: 16px; margin-bottom: 20px; background: #e3f2fd; border-radius: 8px; }
.balance-label { font-size: 14px; color: #555; }
.balance-value { font-size: 28px; font-weight: 700; color: #1976d2; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-bottom: 20px; }
.preset-btn { width: 100%; }
.hint { margin-top: 16px; font-size: 13px; color: #777; }

/* ── Order total ── */
.order-total { background: #e3f2fd; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 15px; }

/* ── Empty state ── */
.empty { text-align: center; color: #999; padding: 40px 0; }

/* ── Skeleton ── */
.skeleton {
  background: #e0e0e0; border-radius: 6px;
}
.skeleton-text { height: 14px; margin-bottom: 10px; }
.skeleton-text.w60 { width: 60%; }
.skeleton-text.w80 { width: 80%; }
.skeleton-text.w40 { width: 40%; }
.skeleton-heading { height: 24px; width: 30%; margin-bottom: 20px; }
.skeleton-card {
  background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  min-height: 180px;
}
.skeleton-card .skeleton-badge { height: 20px; width: 80px; border-radius: 12px; margin-bottom: 12px; }
.skeleton-card .skeleton-title { height: 20px; width: 70%; margin-bottom: 12px; }
.skeleton-card .skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-card .skeleton-btn { height: 32px; width: 100px; border-radius: 6px; margin-top: 16px; }
.skeleton-row { display: flex; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
.skeleton-row > span { height: 14px; flex: 1; }
.skeleton-filter { height: 38px; width: 180px; border-radius: 6px; margin-bottom: 20px; }
.skeleton-table { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.skeleton-table-head { display: flex; gap: 16px; padding: 12px 16px; background: #f5f5f5; }
.skeleton-table-head > span { height: 14px; flex: 1; }
.skeleton-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.skeleton-profile .skeleton-card { min-height: 200px; }
.skeleton-form-card { min-height: 220px; }
.skeleton-input { height: 42px; width: 100%; margin-bottom: 16px; }
.skeleton-select { height: 42px; width: 100%; margin-bottom: 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 15px; }
  .cabinet-sidebar { display: none; }
  .cabinet-main { margin-left: 0; padding: 16px; }
  /* Show a simple top nav on mobile instead */
  .cabinet::before {
    content: '';
    display: block;
  }
}
