/* ============================================================
   Mikrotik Hotspot Builder — PUBLIC Frontend Styles v2.1
   Compatible with Salient theme page content area
   ============================================================ */

.mhb-public-wrap *, .mhb-public-wrap *::before, .mhb-public-wrap *::after { box-sizing: border-box; }

.mhb-public-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: #1e293b; line-height: 1.5; max-width: 1280px; margin: 0 auto; padding-bottom: 60px;
}

/* ---- HERO ---- */
.mhb-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    border-radius: 16px; padding: 48px 40px; text-align: center; margin-bottom: 28px;
    position: relative; overflow: hidden;
}
.mhb-hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 60% at 20% 30%, rgba(37,99,235,0.25) 0%, transparent 60%),
                radial-gradient(ellipse 50% 50% at 80% 70%, rgba(99,102,241,0.2) 0%, transparent 55%);
    pointer-events: none;
}
.mhb-hero-inner { position: relative; z-index: 1; }
.mhb-hero-badge {
    display: inline-block; background: rgba(37,99,235,0.3);
    border: 1px solid rgba(96,165,250,0.4); color: #93c5fd;
    font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
    padding: 5px 14px; border-radius: 100px; margin-bottom: 16px;
}
.mhb-hero-title { font-size: clamp(24px, 4vw, 40px); font-weight: 800; color: #fff; margin: 0 0 10px; line-height: 1.15; letter-spacing: -0.02em; }
.mhb-hero-sub   { font-size: 15px; color: rgba(255,255,255,0.6); margin: 0 auto 28px; max-width: 540px; font-weight: 300; }
.mhb-hero-steps { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; }
.mhb-hs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 500; }
.mhb-hs-num { width: 26px; height: 26px; border-radius: 50%; background: var(--mhb-accent, #2563eb); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mhb-hs-line { width: 36px; height: 1px; background: rgba(255,255,255,0.2); margin: 0 10px; }

/* ---- SECTIONS ---- */
.mhb-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.mhb-pub-hidden { display: none !important; }
.mhb-section-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 26px; border-bottom: 1px solid #f1f5f9; background: #fafbfc; }
.mhb-section-head h2 { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0 0 3px; }
.mhb-section-head p  { font-size: 13px; color: #64748b; margin: 0; }
.mhb-section-foot { padding: 16px 26px; border-top: 1px solid #f1f5f9; background: #fafbfc; display: flex; justify-content: flex-end; }

/* ---- BUTTONS ---- */
.mhb-pub-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.18s; text-decoration: none;
    line-height: 1.4; font-family: inherit;
}
.mhb-pub-btn:focus { outline: 3px solid rgba(37,99,235,0.35); outline-offset: 2px; }
.mhb-pub-btn-primary   { background: var(--mhb-accent, #2563eb); color: #fff; box-shadow: 0 2px 10px rgba(37,99,235,0.3); }
.mhb-pub-btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,0.4); color: #fff; }
.mhb-pub-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.mhb-pub-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.mhb-pub-btn-secondary:hover { background: #e2e8f0; color: #1e293b; }
.mhb-pub-btn-ghost  { background: transparent; color: #64748b; padding: 8px 14px; }
.mhb-pub-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.mhb-back-btn { flex-shrink: 0; }
.mhb-pub-btn-lg { padding: 14px 28px; font-size: 15px; width: 100%; justify-content: center; }

/* ---- TEMPLATE GRID ---- */
.mhb-pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 14px; padding: 22px 26px; }
.mhb-pub-loading { grid-column: 1/-1; text-align: center; color: #94a3b8; padding: 50px; font-size: 14px; }
.mhb-pub-card { border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.18s; background: #fff; position: relative; }
.mhb-pub-card:hover { border-color: #93c5fd; box-shadow: 0 6px 20px rgba(37,99,235,0.12); transform: translateY(-3px); }
.mhb-pub-card.selected { border-color: var(--mhb-accent, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.18); }
.mhb-pub-card-thumb { width: 100%; height: 120px; overflow: hidden; position: relative; }
.mhb-pub-card-thumb svg { width: 100%; height: 100%; }
.mhb-pub-card-check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; background: var(--mhb-accent, #2563eb); color: #fff; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.mhb-pub-card.selected .mhb-pub-card-check { display: flex; }
.mhb-pub-card-info { padding: 11px 13px; border-top: 1px solid #f1f5f9; }
.mhb-pub-card-name { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 3px; }
.mhb-pub-card-desc { font-size: 11px; color: #94a3b8; line-height: 1.4; }
.mhb-pub-card-tag  { display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 600; }
.mhb-pub-card-tag.dark  { background: #1e293b; color: #94a3b8; }
.mhb-pub-card-tag.light { background: #f1f5f9; color: #64748b; }

/* ---- CUSTOMISE LAYOUT ---- */
.mhb-pub-customise-wrap { display: grid; grid-template-columns: 380px 1fr; min-height: 620px; }

/* ---- FORM PANEL ---- */
.mhb-pub-form-panel { padding: 22px; border-right: 1px solid #f1f5f9; overflow-y: auto; max-height: 720px; }
.mhb-pub-form-group { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f8fafc; }
.mhb-pub-form-group:last-of-type { border-bottom: none; }
.mhb-pub-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; margin-bottom: 13px; }
.mhb-pub-field { margin-bottom: 13px; }
.mhb-pub-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.mhb-optional { font-weight: 400; color: #94a3b8; font-size: 11px; }
.mhb-pub-field input[type="text"],
.mhb-pub-field input[type="url"],
.mhb-pub-field input[type="email"],
.mhb-pub-field input[type="tel"],
.mhb-pub-field input[type="number"] {
    width: 100%; border: 1.5px solid #d1d5db; border-radius: 8px;
    padding: 9px 12px; font-size: 13px; color: #111827;
    font-family: inherit; transition: border-color 0.18s, box-shadow 0.18s; background: #fff;
}
.mhb-pub-field input:focus { outline: none; border-color: var(--mhb-accent, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.mhb-field-hint { display: block; font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* Color row */
.mhb-color-row { display: flex; align-items: center; gap: 10px; }
.mhb-color-input { width: 44px !important; height: 38px; padding: 2px 3px !important; border-radius: 6px !important; cursor: pointer; flex-shrink: 0; }
.mhb-color-hex { flex: 1; }

/* Dimension row */
.mhb-dim-row label { margin-bottom: 8px; }
.mhb-wh-row { display: flex; align-items: center; gap: 6px; }
.mhb-wh-row span { font-size: 12px; font-weight: 600; color: #64748b; }
.mhb-wh-row input { width: 72px !important; text-align: center; }

/* Upload / URL tabs */
.mhb-upload-or-url { margin-top: 4px; }
.mhb-upload-tab-btns { display: flex; gap: 4px; margin-bottom: 10px; }
.mhb-tab-btn {
    padding: 5px 14px; font-size: 12px; font-weight: 600;
    border: 1.5px solid #d1d5db; border-radius: 6px; cursor: pointer;
    background: #f8fafc; color: #64748b; font-family: inherit; transition: all 0.15s;
}
.mhb-tab-btn.active { background: var(--mhb-accent, #2563eb); color: #fff; border-color: var(--mhb-accent, #2563eb); }
.mhb-tab-btn:hover:not(.active) { background: #f1f5f9; border-color: #94a3b8; }

/* File upload */
.mhb-file-input { display: none; }
.mhb-file-label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: 1.5px dashed #d1d5db; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: #64748b; cursor: pointer;
    transition: all 0.18s; background: #fafbfc; width: 100%; justify-content: center;
}
.mhb-file-label:hover { border-color: var(--mhb-accent, #2563eb); color: var(--mhb-accent, #2563eb); background: rgba(37,99,235,0.04); }

/* Image previews */
.mhb-pub-img-preview {
    margin-top: 10px; display: flex; align-items: center; gap: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; flex-wrap: wrap;
}
.mhb-pub-img-preview img { max-width: 100px; max-height: 50px; object-fit: contain; border-radius: 4px; }
.mhb-pub-remove-img {
    font-size: 12px; color: #ef4444; background: none;
    border: 1px solid #fca5a5; border-radius: 5px; padding: 3px 8px;
    cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.mhb-pub-remove-img:hover { background: #fee2e2; }

/* Form CTA */
.mhb-pub-form-cta { margin-top: 8px; padding-top: 18px; border-top: 1px solid #f1f5f9; }
.mhb-pub-form-cta .mhb-pub-btn { width: 100%; justify-content: center; }

/* ---- PREVIEW PANEL ---- */
.mhb-pub-preview-panel { display: flex; flex-direction: column; background: #f0f4f8; }
.mhb-pub-preview-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.mhb-pub-preview-label { font-size: 13px; font-weight: 700; color: #374151; }
.mhb-pub-device-btns { display: flex; gap: 6px; }
.mhb-pub-dev { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 12px; font-size: 14px; cursor: pointer; transition: all 0.15s; font-family: inherit; color: #64748b; }
.mhb-pub-dev.active { background: var(--mhb-accent, #2563eb); color: #fff; border-color: var(--mhb-accent, #2563eb); }
.mhb-pub-preview-frame-wrap { flex: 1; position: relative; padding: 14px; display: flex; align-items: stretch; justify-content: center; min-height: 560px; }
.mhb-pub-preview-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f0f4f8; z-index: 10; gap: 12px; font-size: 13px; color: #94a3b8; }
.mhb-pub-spinner { width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: var(--mhb-accent, #2563eb); border-radius: 50%; animation: mhb-spin 0.8s linear infinite; }
@keyframes mhb-spin { to { transform: rotate(360deg); } }
#mhb-pub-preview-frame { flex: 1; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.15); background: #fff; transition: width 0.3s; }
.mhb-pub-preview-note { padding: 9px 18px; font-size: 11px; color: #94a3b8; background: #fff; border-top: 1px solid #e2e8f0; text-align: center; }
.mhb-pub-preview-note code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: 10px; }

/* ---- DOWNLOAD ---- */
.mhb-pub-download-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding: 24px 26px; }
.mhb-pub-final-preview-wrap { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.mhb-pub-browser-chrome { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; padding: 8px 14px; display: flex; align-items: center; gap: 10px; }
.mhb-bc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mhb-bc-dot:nth-child(1) { background: #fc5c63; }
.mhb-bc-dot:nth-child(2) { background: #fdbc40; }
.mhb-bc-dot:nth-child(3) { background: #34c84a; }
.mhb-bc-bar { flex: 1; background: #e2e8f0; border-radius: 4px; padding: 4px 10px; font-size: 11px; color: #64748b; font-family: monospace; }
.mhb-pub-dl-sidebar { display: flex; flex-direction: column; gap: 14px; }
.mhb-pub-dl-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.mhb-pub-dl-icon { font-size: 30px; }
.mhb-pub-dl-card h3 { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0; }
.mhb-pub-dl-card p  { font-size: 13px; color: #64748b; margin: 0; line-height: 1.6; }
.mhb-pub-dl-card code { background: #e2e8f0; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.mhb-pub-deploy-card { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; }
.mhb-pub-deploy-card h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #1d4ed8; margin: 0 0 10px; }
.mhb-pub-deploy-card ol { margin: 0; padding-left: 18px; }
.mhb-pub-deploy-card li { font-size: 13px; color: #1e3a5f; margin-bottom: 6px; line-height: 1.5; }
.mhb-pub-deploy-card code { background: rgba(37,99,235,0.1); color: #1d4ed8; padding: 1px 5px; border-radius: 3px; font-size: 11px; }
.mhb-pub-ftp-box { margin-top: 10px; background: rgba(37,99,235,0.08); border-radius: 6px; padding: 9px 12px; font-size: 12px; color: #1d4ed8; }
.mhb-pub-ftp-box code { display: block; margin-top: 3px; font-family: monospace; font-size: 12px; }
.mhb-pub-support-card { font-size: 13px; color: #64748b; text-align: center; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.mhb-pub-support-card a { color: var(--mhb-accent, #2563eb); text-decoration: none; }
.mhb-pub-support-card a:hover { text-decoration: underline; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .mhb-pub-customise-wrap { grid-template-columns: 1fr; }
    .mhb-pub-form-panel { max-height: none; border-right: none; border-bottom: 1px solid #f1f5f9; }
    .mhb-pub-download-wrap { grid-template-columns: 1fr; }
    .mhb-pub-dl-sidebar { order: -1; }
}
@media (max-width: 640px) {
    .mhb-hero { padding: 32px 18px; }
    .mhb-section-head { padding: 14px 16px; }
    .mhb-section-foot { padding: 12px 16px; }
    .mhb-pub-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 14px 16px; }
    .mhb-pub-form-panel { padding: 16px; }
    .mhb-pub-download-wrap { padding: 16px; }
    .mhb-hs-line { width: 18px; margin: 0 5px; }
    .mhb-wh-row input { width: 60px !important; }
}
