/* =============================================================
   Auction Platform — B2B SaaS theme
   Stack: Bootstrap 5 + custom CSS variables
   Fonts: IBM Plex Sans Thai (TH) + Inter (Latin) + JetBrains Mono
   ============================================================= */

:root {
  /* ---- brand palette (B2B trust + warm accent) ---- */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;
  --brand-950: #0c1f4a;

  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  --success-500: #10b981;
  --warn-500:    #f59e0b;
  --danger-500:  #ef4444;

  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;
  --surface: #ffffff;

  /* radii / shadows */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 22px;
  --shadow-1: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow-2: 0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -1px rgba(15,23,42,.05);
  --shadow-3: 0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -2px rgba(15,23,42,.05);
  --shadow-glow: 0 12px 30px -10px rgba(37,99,235,.45);

  /* Bootstrap overrides */
  --bs-primary:        var(--brand-700);
  --bs-primary-rgb:    29, 78, 216;
  --bs-body-color:     var(--ink-800);
  --bs-body-bg:        var(--ink-50);
  --bs-border-color:   var(--ink-200);
  --bs-link-color:     var(--brand-700);
  --bs-link-hover-color: var(--brand-900);

  --bs-font-sans-serif: "IBM Plex Sans Thai", "Inter", system-ui, -apple-system,
                        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-monospace:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- base ---- */
html,body { font-family: var(--bs-font-sans-serif); -webkit-font-smoothing: antialiased; }
html:lang(en) body { font-feature-settings: "ss01","cv11"; }
body { background: var(--ink-50); color: var(--ink-800); line-height: 1.55; }
.text-muted { color: var(--ink-500) !important; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
code,pre { font-family: var(--bs-font-monospace); font-size: .9em; }
.bg-surface { background: var(--surface) !important; }
.bg-ink-50  { background: var(--ink-50)  !important; }
.bg-ink-900 { background: var(--ink-900) !important; color: var(--ink-100); }
.text-brand { color: var(--brand-700) !important; }
.text-ink-500 { color: var(--ink-500) !important; }

h1,h2,h3,h4,h5 { font-weight: 700; color: var(--ink-900); }
html:lang(en) h1, html:lang(en) h2, html:lang(en) h3, html:lang(en) h4, html:lang(en) h5 { letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); line-height: 1.2; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  color: var(--brand-700); font-weight: 700;
}

/* ---- navbar ---- */
.app-nav {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1.5px solid var(--ink-300);
  position: sticky; top: 0; z-index: 1030;
}
.app-nav .navbar-brand {
  font-weight: 800; color: var(--ink-900);
  display: flex; align-items: center; gap: .55rem;
}
.app-nav .navbar-brand .logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-900));
  color: #fff; font-size: 1rem; box-shadow: var(--shadow-glow);
}
.app-nav .nav-link { color: var(--ink-700); font-weight: 500; }
.app-nav .nav-link:hover { color: var(--brand-700); }
.app-nav .nav-link.active { color: var(--brand-700); }

/* ---- buttons ---- */
.btn { font-weight: 600; border-radius: var(--r); padding: .55rem 1.05rem; transition: all .15s ease; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-primary { background: var(--brand-700); border-color: var(--brand-700); }
.btn-primary:hover { background: var(--brand-800); border-color: var(--brand-800); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-outline-primary { color: var(--brand-700); border-color: var(--brand-200); }
.btn-outline-primary:hover { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-300); }
.btn-cta { background: var(--accent-500); border-color: var(--accent-500); color: #fff; }
.btn-cta:hover { background: var(--accent-600); border-color: var(--accent-600); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(245,158,11,.5); }
.btn-soft { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-900); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-900); }

/* ---- cards ---- */
.card { border: 1.5px solid var(--ink-300); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-header { background: var(--ink-50); border-bottom: 1.5px solid var(--ink-300); font-weight: 600; }
.card.elevated { box-shadow: var(--shadow-2); }
.card.featured { border: 2px solid var(--brand-300); box-shadow: var(--shadow-3); position: relative; }
.feature-card { padding: 1.4rem; height: 100%; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); border-color: var(--brand-200); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-50); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: .9rem;
  border: 1px solid var(--brand-100);
}
.stat-card .h2 { color: var(--brand-700); font-weight: 800; }

/* ---- hero ---- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(900px 460px at -10% 110%, rgba(245,158,11,.10), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--ink-50) 100%);
  padding: 5rem 0 4.5rem;
}
.hero .badge-trial {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand-50); color: var(--brand-800);
  padding: .35rem .75rem; border-radius: 999px;
  font-weight: 600; font-size: .85rem;
  border: 1px solid var(--brand-100);
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-700), var(--accent-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-mock {
  border-radius: var(--r-xl); box-shadow: var(--shadow-3);
  border: 1px solid var(--ink-200); background: #fff;
  overflow: hidden;
}
.hero-mock .mock-bar {
  display: flex; gap: 6px; padding: 10px 12px; background: var(--ink-100);
  border-bottom: 1px solid var(--ink-200);
}
.hero-mock .mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.hero-mock .mock-bar span:first-child { background: #ef4444; }
.hero-mock .mock-bar span:nth-child(2) { background: #f59e0b; }
.hero-mock .mock-bar span:nth-child(3) { background: #10b981; }
.hero-mock .mock-body { padding: 1rem 1.1rem; }

/* ---- sections ---- */
section { padding: 4.5rem 0; }
section.tight { padding: 3rem 0; }
section.alt { background: #fff; }
.section-title { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.section-title p { color: var(--ink-500); font-size: 1.05rem; }

/* ---- pricing ---- */
.price-card { padding: 2rem 1.6rem; height: 100%; display: flex; flex-direction: column; }
.price-card .plan-name { font-weight: 700; color: var(--ink-900); }
.price-card .price { font-size: 2.6rem; font-weight: 800; color: var(--ink-900); line-height: 1; }
.price-card .price small { font-size: .9rem; font-weight: 500; color: var(--ink-500); }
.price-card ul { list-style: none; padding: 0; margin: 1.4rem 0; }
.price-card ul li { padding: .5rem 0; color: var(--ink-700); border-bottom: 1px dashed var(--ink-200); }
.price-card ul li i { color: var(--success-500); margin-right: .5rem; }
.price-card.popular { border-color: var(--brand-600); position: relative; transform: translateY(-6px); }
.price-card.popular .popular-tag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--brand-700); color: #fff; padding: .25rem .9rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .05em;
}

/* ---- steps ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 768px) { .steps { grid-template-columns: 1fr 1fr; } }
.step {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--r-lg);
  padding: 1.4rem; position: relative;
}
.step .num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-700); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: .8rem;
}

/* ---- testimonials ---- */
.t-card { padding: 1.6rem; height: 100%; }
.t-card blockquote { font-size: 1.02rem; color: var(--ink-700); margin-bottom: 1rem; }
.t-card .who { display: flex; align-items: center; gap: .8rem; }
.t-card .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-300));
  color: var(--brand-900); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ---- FAQ ---- */
.accordion-button { font-weight: 600; color: var(--ink-900); }
.accordion-button:not(.collapsed) { color: var(--brand-800); background: var(--brand-50); }
.accordion-item { border: 1px solid var(--ink-200); border-radius: var(--r) !important; margin-bottom: .6rem; overflow: hidden; }

/* ---- footer ---- */
.footer { background: var(--ink-900); color: var(--ink-200); padding: 3.5rem 0 2rem; }
.footer h6 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.footer a { color: var(--ink-200); display: block; padding: .25rem 0; }
.footer a:hover { color: #fff; }
.footer .footer-bottom { border-top: 1px solid #1f2a44; margin-top: 2.5rem; padding-top: 1.4rem; color: var(--ink-400); font-size: .85rem; }

/* ---- forms ---- */
.form-control, .form-select {
  border-radius: var(--r); border: 1.5px solid var(--ink-400);
  padding: .65rem .85rem; font-size: .95rem;
  background: white;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(37,99,235,.18);
  background: white;
}
.form-control::placeholder { color: var(--ink-500); }
.form-label { font-weight: 600; color: var(--ink-800); margin-bottom: .35rem; }
.input-group-text { border: 1.5px solid var(--ink-400); background: var(--ink-100); color: var(--ink-700); }
.form-check-input { border: 1.5px solid var(--ink-400); }
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }

/* ---- badges ---- */
.badge {
  font-weight: 600; border-radius: 6px; padding: .3em .6em;
  font-size: .75em; letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge.bg-secondary   { background: var(--ink-100) !important; color: var(--ink-700) !important; border-color: var(--ink-300); }
.badge.bg-success     { background: rgba(16,185,129,.12) !important; color: #047857 !important; border-color: rgba(16,185,129,.25); }
.badge.bg-danger      { background: rgba(239,68,68,.12) !important; color: #b91c1c !important; border-color: rgba(239,68,68,.25); }
.badge.bg-warning     { background: rgba(245,158,11,.12) !important; color: #92400e !important; border-color: rgba(245,158,11,.25); }
.badge.bg-primary     { background: var(--brand-50) !important; color: var(--brand-800) !important; border-color: var(--brand-200); }
.badge.bg-info        { background: rgba(6,182,212,.10) !important; color: #0e7490 !important; border-color: rgba(6,182,212,.25); }
.badge.bg-light       { background: var(--ink-50) !important; color: var(--ink-700) !important; border-color: var(--ink-300); }
.badge.bg-success-subtle { background: rgba(16,185,129,.08) !important; color: #047857 !important; border-color: rgba(16,185,129,.2); }
.badge.bg-warning-subtle { background: rgba(245,158,11,.08) !important; color: #92400e !important; border-color: rgba(245,158,11,.2); }
.badge.bg-primary-subtle { background: var(--brand-50) !important; color: var(--brand-700) !important; border-color: var(--brand-100); }
.badge.bg-danger-subtle  { background: rgba(239,68,68,.08) !important; color: #b91c1c !important; border-color: rgba(239,68,68,.2); }
.badge.bg-secondary-subtle { background: var(--ink-50) !important; color: var(--ink-600) !important; border-color: var(--ink-200); }

/* accent-border cards */
.card-accent-brand   { border-left: 4px solid var(--brand-500) !important; }
.card-accent-success { border-left: 4px solid var(--success-500) !important; }
.card-accent-danger  { border-left: 4px solid var(--danger-500) !important; }
.card-accent-warn    { border-left: 4px solid var(--warn-500) !important; }

/* Bootstrap border-color overrides */
.border-primary { border-color: var(--brand-300) !important; }
.border-success { border-color: rgba(16,185,129,.4) !important; }
.border-danger  { border-color: rgba(239,68,68,.4) !important; }
.border-warning { border-color: rgba(245,158,11,.4) !important; }
.card.border-primary { border: 1.5px solid var(--brand-300) !important; }
.card.border-danger  { border: 1.5px solid rgba(239,68,68,.3) !important; }
.card.border-warning { border: 1.5px solid rgba(245,158,11,.3) !important; }

/* alert styling */
.alert { border-radius: var(--r); border: 1.5px solid var(--ink-200); }
.alert-info    { background: rgba(6,182,212,.06); border-color: rgba(6,182,212,.2); color: #0e7490; }
.alert-success { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.2); color: #047857; }
.alert-warning { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.2); color: #92400e; }
.alert-danger  { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.2); color: #b91c1c; }
.alert-light   { background: var(--ink-50); border-color: var(--ink-300); color: var(--ink-800); }

/* table borders */
.table { --bs-table-border-color: var(--ink-300); }
.table thead th { border-bottom-width: 2px; }
.list-group-item { border-color: var(--ink-300); }

/* ---- auth split ---- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 992px) { .auth-split { grid-template-columns: 1fr; } .auth-side { display: none; } }
.auth-side {
  background:
    radial-gradient(700px 380px at 80% 10%, rgba(255,255,255,.12), transparent),
    linear-gradient(160deg, var(--brand-800), var(--brand-950));
  color: #fff; padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-form-wrap { padding: 3rem; display: flex; align-items: center; justify-content: center; background: #fff; }
.auth-form { width: 100%; max-width: 460px; }
.auth-side .quote { font-size: 1.25rem; line-height: 1.5; color: rgba(255,255,255,.92); }
.auth-side .feature-list i { color: var(--accent-400); margin-right: .55rem; }

/* ---- stepper ---- */
.stepper { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.6rem; }
.stepper .s {
  flex: 1; display: flex; align-items: center; gap: .5rem;
  color: var(--ink-500); font-weight: 600; font-size: .9rem;
}
.stepper .s .dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink-200); color: var(--ink-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
}
.stepper .s.done .dot { background: var(--success-500); color: #fff; }
.stepper .s.active { color: var(--brand-800); }
.stepper .s.active .dot { background: var(--brand-700); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.stepper .bar { flex: 1; height: 2px; background: var(--ink-200); border-radius: 2px; }
.stepper .bar.done { background: var(--success-500); }

/* ---- dashboard sidebar ---- */
.dash {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh;
  background: var(--ink-50);
}
.dash-main { min-width: 0; overflow-x: auto; }
.dash-sidebar {
  background: #fff; border-right: 1.5px solid var(--ink-300);
  padding: .85rem .7rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: transform .3s ease, width .3s ease;
  z-index: 1040;
  font-size: .85rem;
}
.dash-sidebar .brand { display: flex; align-items: center; gap: .5rem; padding: .15rem .4rem .85rem; }
.dash-sidebar .brand .fs-5 { font-size: 1.05rem !important; }
.dash-sidebar .nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-500); margin: .75rem .55rem .25rem;
  cursor: pointer; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
}
.dash-sidebar .nav-section .toggle-icon { transition: transform .2s; font-size: 9px; }
.dash-sidebar .nav-section.collapsed .toggle-icon { transform: rotate(-90deg); }
.dash-sidebar .nav-group { overflow: hidden; transition: max-height .3s ease; max-height: 500px; }
.dash-sidebar .nav-group.collapsed { max-height: 0; }
.dash-sidebar a.nav-item {
  display: flex; align-items: center; gap: .55rem;
  color: var(--ink-700); padding: .42rem .6rem; border-radius: var(--r-sm);
  font-weight: 500; font-size: .82rem; line-height: 1.25;
  min-height: 34px;
  min-width: 0;
  overflow: hidden;
}
.dash-sidebar a.nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-sidebar a.nav-item:hover { background: var(--ink-100); color: var(--ink-900); }
.dash-sidebar a.nav-item.active { background: var(--brand-50); color: var(--brand-800); font-weight: 600; }
.dash-sidebar a.nav-item i { width: 16px; text-align: center; color: var(--ink-500); font-size: .9em; }
.dash-sidebar a.nav-item.active i { color: var(--brand-700); }
.dash-sidebar a.nav-item .icon-svg { color: var(--ink-500); flex-shrink: 0; width: 16px; height: 16px; }
.dash-sidebar a.nav-item.active .icon-svg { color: var(--brand-700); }
.dash-sidebar a.nav-item .badge { font-size: .65rem; }
.icon-svg { display: inline-block; vertical-align: -3px; }
.dash-main { padding: 1.5rem 2rem; }

/* Mobile sidebar */
.sidebar-toggle { display: none; }
@media (max-width: 992px) {
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: fixed; top: 0; left: 0; width: 280px;
    transform: translateX(-100%); box-shadow: none;
  }
  .dash-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3);
    z-index: 1035;
  }
  .sidebar-overlay.show { display: block; }
  .dash-main { padding: 1rem; }
}
@media (max-width: 576px) {
  .dash-main { padding: .75rem; }
  h1 { font-size: 1.6rem; }
  .card { border-radius: 8px; }
}
.dash-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: .8rem 1.2rem; border-radius: var(--r-lg);
  border: 1.5px solid var(--ink-300); margin-bottom: 1.4rem;
}

/* ---- realtime panel ---- */
.realtime-panel { background: linear-gradient(180deg, #fff, var(--brand-50)); border: 1px solid var(--brand-100); }
.realtime-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success-500); display: inline-block; margin-right: .35rem; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: pulse 2s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ---- helpers ---- */
.divider { height: 1px; background: var(--ink-200); margin: 2rem 0; }
.kbd { font-family: var(--bs-font-monospace); font-size: .8rem; padding: .15rem .4rem; background: var(--ink-100); border: 1px solid var(--ink-200); border-bottom-width: 2px; border-radius: 6px; }
.fade-up { animation: fadeUp .6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ---- touch targets + responsive tweaks (ui2.md) ---- */
.btn { min-height: 38px; }
.btn-sm { min-height: 32px; }
.btn-lg { min-height: 48px; padding: .75rem 1.5rem; }
.nav-link { min-height: 44px; display: inline-flex; align-items: center; }
.dropdown-item { min-height: 40px; display: flex; align-items: center; }
.form-check-input { min-width: 20px; min-height: 20px; }
.form-select, .form-control { min-height: 42px; }

/* CTA buttons stand out */
.btn-cta {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700)) !important;
  border: none !important; color: white !important;
  font-weight: 600; box-shadow: 0 4px 12px rgba(37,99,235,.25);
  transition: all .2s;
}
.btn-cta:hover {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-800)) !important;
  box-shadow: 0 6px 16px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

/* Better table on mobile */
@media (max-width: 768px) {
  .table-responsive { border-radius: var(--r); }
  .table th, .table td { font-size: .85rem; padding: .5rem .4rem; }
}
