/* HostPanel storefront — colors come from CSS variables set by the layout (admin/reseller branding). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font, system-ui, sans-serif); color: var(--text, #111827); background: var(--bg, #f7f8fb); line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted, #6b7280); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; }
.pre { white-space: pre-line; }
.inline { display: inline; }
.main { min-height: 60vh; }
.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 28px; }

/* header / nav */
.site-header { background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; color: var(--header-text); font-weight: 700; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-logo { max-height: 40px; width: auto; }
.site-nav { margin-left: auto; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.menu li { position: relative; }
.menu a, .menu .link-button { display: block; padding: 8px 12px; color: inherit; border-radius: 8px; }
.menu a:hover, .menu .link-button:hover { background: rgba(127,127,127,.12); text-decoration: none; }
.menu li.active > a { color: var(--primary); font-weight: 600; }
.menu .menu { display: none; position: absolute; right: 0; top: 100%; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; flex-direction: column; align-items: stretch; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.menu li:hover > .menu, .menu li:focus-within > .menu { display: flex; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; color: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--header-bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; }
  .site-nav.open { display: block; }
  .menu { flex-direction: column; align-items: stretch; }
  .menu .menu { position: static; display: flex; box-shadow: none; border: 0; padding-left: 12px; }
}

/* footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 48px; padding: 36px 0 18px; }
.site-footer a { color: var(--footer-text); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .menu { flex-direction: column; align-items: flex-start; }
.footer-note { margin-top: 24px; font-size: .85rem; opacity: .75; }

/* buttons, forms */
.btn { display: inline-block; padding: 10px 18px; border-radius: var(--radius, 10px); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.block { display: block; width: 100%; }
.link-button { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }
.link-button.danger { color: #dc2626; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.form-narrow { max-width: 520px; }

/* cards, grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.product-card { display: flex; flex-direction: column; }
.product-card .btn { margin-top: auto; }
.price { margin: 8px 0 14px; }
.price .amount { font-size: 2rem; font-weight: 800; }
.price .per { color: var(--muted); margin-left: 4px; }
.features { list-style: none; padding: 0; margin: 0 0 18px; }
.features li { padding: 6px 0 6px 24px; position: relative; border-bottom: 1px dashed var(--border); }
.features li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.feature h3 { font-size: 1.1rem; }
.category-title { margin-top: 32px; }

/* sections */
.hero { padding: 88px 0; background: linear-gradient(135deg, var(--primary), var(--accent)); background-size: cover; background-position: center; color: #fff; }
.hero.align-center { text-align: center; }
.hero .lead { font-size: 1.25rem; opacity: .95; max-width: 720px; }
.hero.align-center .lead { margin-left: auto; margin-right: auto; }
.hero .btn-primary { background: #fff; color: var(--primary); border-color: #fff; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--primary); color: var(--primary-text); border-radius: var(--radius); padding: 32px; }
.cta h2 { margin: 0 0 6px; }
.cta p { margin: 0; opacity: .9; }
.faq { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.quote p { font-style: italic; }
.figure { text-align: center; }
.prose p { margin-bottom: 1em; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tfoot th { font-size: 1rem; }
.num { text-align: right !important; white-space: nowrap; }
.row-actions { white-space: nowrap; }

/* badges, alerts */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; text-transform: capitalize; background: #e5e7eb; color: #374151; }
.status-active, .status-paid { background: #dcfce7; color: #166534; }
.status-pending, .status-provisioning, .status-unpaid { background: #fef9c3; color: #854d0e; }
.status-suspended, .status-failed, .status-cancelled, .status-terminated { background: #fee2e2; color: #991b1b; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 0; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.safe-mode { background: #111827; color: #fde68a; padding: 8px 16px; text-align: center; font-size: .9rem; }
.safe-mode a { color: #fff; text-decoration: underline; }

/* product page */
.product-page { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .product-page { grid-template-columns: 1fr; } }
.auth-card { max-width: 440px; margin: 0 auto; }

/* client area */
.client-grid { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
@media (max-width: 860px) { .client-grid { grid-template-columns: 1fr; } }
.client-nav .menu { flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.client-main h2 { margin-top: 32px; }
.stat { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.service-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.service-meta { text-align: right; }
.service-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.usage { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.usage-label { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; margin-bottom: 6px; }
.bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); }
.bar-fill.warn { background: #dc2626; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.details dt { font-weight: 600; color: var(--muted); }
.details dd { margin: 0; word-break: break-all; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.action { padding: 14px; }
.console-log { max-height: 320px; overflow: auto; background: #0b1020; color: #d1fae5; padding: 12px; border-radius: 8px; white-space: pre-wrap; }
.invoice-head, .invoice-parties { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
@media print { .site-header, .site-footer, .client-nav, .btn { display: none !important; } .card { border: 0; } }

/* console */
body.blank { background: #000; color: #e5e7eb; }
.console-shell { display: flex; flex-direction: column; height: 100vh; }
.console-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #111827; color: #e5e7eb; }
.console-bar .btn { background: #1f2937; color: #e5e7eb; border-color: #374151; }
.console-bar .spacer { flex: 1; }
.console-screen { flex: 1; overflow: hidden; }
