/* ========================================================
   RGNet Billing - Core Styles
   Tailwind CSS (CDN) is loaded in layout; we add custom
   variables, base styles and component classes to match
   the screenshot reference pixel-perfectly.
   ======================================================== */

:root {
    --bg-primary: #0a0a0d;
    --bg-secondary: #0d0d12;
    --bg-card: #0f0f14;
    --bg-elevated: #14141b;
    --border: #1f1f29;
    --border-light: #2a2a36;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #ff6b00;
    --accent-hover: #ff8533;
    --accent-glow: rgba(255, 107, 0, 0.35);
    --accent-soft: rgba(255, 107, 0, 0.08);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #a855f7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', system-ui, Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% -10%, rgba(255,107,0,0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 0%, rgba(168,85,247,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app-shell { position: relative; z-index: 1; }

/* ===== Header ===== */
.rg-header {
    background: linear-gradient(180deg, rgba(20,20,27,0.85) 0%, rgba(13,13,18,0.75) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rg-logo { display: flex; align-items: center; gap: 12px; }
.rg-logo-icon { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.rg-logo-mark {
    color: var(--accent);
    filter: drop-shadow(0 0 12px rgba(255,107,0,0.6));
}
.rg-logo-text { font-weight: 800; font-size: 26px; letter-spacing: -0.02em; color: #fff; line-height: 1; }
.rg-logo-tag { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }
.rg-header-actions { display: flex; align-items: center; gap: 14px; }
.rg-icon-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.rg-icon-btn:hover { color: #fff; background: var(--bg-elevated); }
.rg-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* ===== Hero ===== */
.rg-hero {
    position: relative;
    border-radius: 24px;
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse at 100% 30%, rgba(255,107,0,0.15) 0%, transparent 60%),
        linear-gradient(135deg, #0c0c12 0%, #0a0a0f 40%, #111118 100%);
    overflow: hidden;
    padding: 32px 28px 36px;
    min-height: 320px;
}
.rg-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(0,0,0,0.2) 0%, transparent 50%),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='4' fill='%23ffffff' fill-opacity='0.015'/></svg>");
    pointer-events: none;
}
.rg-badge-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.rg-badge-pill .dot { color: var(--accent); }
.rg-hero h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0 0 14px;
    color: #fff;
}
.rg-hero h1 .accent { color: var(--accent); }
.rg-hero p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 0 24px;
    line-height: 1.6;
}
.rg-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.rg-hero-image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    max-width: 520px;
    pointer-events: none;
    opacity: 0.95;
    display: none;
}
@media (min-width: 900px) { .rg-hero-image { display: block; } }
.rg-router-img {
    width: 100%; height: auto;
    filter: drop-shadow(0 30px 60px rgba(0,0,0,0.6)) drop-shadow(0 0 40px rgba(255,107,0,0.15));
}
.rg-wifi-pulse {
    position: absolute;
    right: 28%;
    top: 18%;
    color: var(--accent);
    opacity: 0.7;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

/* ===== Buttons ===== */
.rg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.rg-btn:active { transform: scale(0.98); }
.rg-btn-primary {
    background: linear-gradient(180deg, #ff8533 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 8px 20px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.rg-btn-primary:hover {
    background: linear-gradient(180deg, #ff9d5c 0%, #ff7a1f 100%);
    box-shadow: 0 10px 28px -6px var(--accent-glow);
}
.rg-btn-ghost {
    background: rgba(255,255,255,0.03);
    color: #fff;
    border-color: var(--border-light);
    backdrop-filter: blur(8px);
}
.rg-btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: #3a3a48; }
.rg-btn-sm { padding: 10px 16px; font-size: 14px; border-radius: 12px; }
.rg-btn-block { width: 100%; }

/* ===== Card / Section ===== */
.rg-section {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 28px;
}
.rg-section-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 22px; flex-wrap: wrap;
}
.rg-pill-label {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--accent-soft);
}
.rg-section h2 { font-size: clamp(24px,3.4vw,32px); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 6px; }
.rg-section p.section-desc { color: var(--text-secondary); margin: 0; max-width: 640px; }

.rg-link-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
    white-space: nowrap;
}
.rg-link-btn:hover { border-color: var(--accent); color: var(--accent); }
.rg-link-btn .arrow { transition: transform .2s; color: var(--accent); }
.rg-link-btn:hover .arrow { transform: translateX(3px); }

/* ===== Features ===== */
.rg-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
}
.rg-feature {
    padding: 28px 20px;
    text-align: center;
    position: relative;
}
.rg-feature + .rg-feature::before {
    content: "";
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 1px; background: var(--border);
}
.rg-feature-icon {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 1.5px solid var(--border-light);
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(255,107,0,0.12), transparent 70%);
    color: var(--accent);
}
.rg-feature h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.rg-feature p { margin: 0; font-size: 13px; color: var(--text-secondary); }

@media (max-width: 768px) {
    .rg-features { grid-template-columns: repeat(2, 1fr); }
    .rg-feature:nth-child(3)::before { display: none; }
    .rg-feature { padding: 22px 16px; }
}

/* ===== Package Cards ===== */
.rg-package-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) { .rg-package-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .rg-package-grid { grid-template-columns: 1fr; } }

.rg-pkg {
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #111119 0%, #0c0c12 100%);
    padding: 22px;
    transition: transform .2s, border-color .2s;
    overflow: hidden;
}
.rg-pkg:hover { transform: translateY(-4px); border-color: var(--border-light); }
.rg-pkg.featured {
    border-color: var(--accent);
    background: linear-gradient(180deg, #1a110a 0%, #0c0a08 100%);
    box-shadow: 0 0 0 1px rgba(255,107,0,0.25), 0 20px 40px -20px var(--accent-glow);
}
.rg-pkg.featured::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(255,107,0,0.12), transparent 70%);
    pointer-events: none;
}
.rg-pkg-popular {
    position: absolute;
    top: 18px; right: 18px;
    background: var(--accent);
    color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.rg-pkg-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.rg-pkg-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }
.rg-pkg-icon-float { position: absolute; top: 20px; right: 20px; opacity: 0.9; }

/* Speed gauge (conic half-circle) */
.rg-gauge {
    position: relative;
    width: 170px;
    height: 95px;
    margin: 8px auto 6px;
    overflow: hidden;
}
.rg-gauge::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 170px 170px 0 0;
    background: conic-gradient(from 200deg at 50% 100%,
        var(--gauge-color, var(--accent)) 0deg,
        var(--gauge-color, var(--accent)) var(--gauge-amount, 180deg),
        rgba(255,255,255,0.08) var(--gauge-amount, 180deg),
        rgba(255,255,255,0.08) 320deg);
    -webkit-mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 60%);
            mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 60%);
}
.rg-gauge-center {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
}
.rg-gauge-value { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.rg-gauge-unit { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin-top: 2px; }
.rg-gauge-ticks { position: absolute; inset: 0; pointer-events: none; }

.rg-pkg-price {
    display: flex; align-items: baseline; gap: 6px;
    margin: 14px 0 16px;
}
.rg-pkg-price .rp { font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.rg-pkg-price .nominal { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.rg-pkg-price .per { font-size: 13px; color: var(--text-muted); }
.rg-pkg-price .strike { font-size: 14px; color: var(--text-muted); text-decoration: line-through; margin-right: 6px; }

.rg-pkg-benefits { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.rg-pkg-benefits li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: var(--text-secondary);
}
.rg-pkg-benefits li .check {
    flex-shrink: 0;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.rg-pkg.featured .rg-pkg-benefits li .check { background: var(--accent); color: #fff; }

/* CTA banner */
.rg-cta {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, #111117 0%, #0c0c10 100%);
    padding: 24px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap;
}
.rg-cta-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,107,0,0.2), transparent 70%);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rg-cta-text h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.rg-cta-text p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.rg-cta-left { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 260px; }

/* ===== Bottom Navigation (Mobile) ===== */
.rg-bottom-nav {
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 50;
    background: linear-gradient(180deg, rgba(18,18,24,0.95) 0%, rgba(10,10,13,0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 22px;
    padding: 8px 6px;
    display: none;
    box-shadow: 0 -6px 40px rgba(0,0,0,0.4);
}
@media (max-width: 768px) {
    .rg-bottom-nav { display: flex; justify-content: space-around; align-items: center; }
    body { padding-bottom: 90px; }
}
.rg-nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 6px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color .2s;
    position: relative;
}
.rg-nav-item svg { width: 24px; height: 24px; }
.rg-nav-item.active { color: var(--accent); }
.rg-nav-item.active::before {
    content: "";
    position: absolute; top: 0; left: 20%; right: 20%;
    height: 3px; border-radius: 0 0 3px 3px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

/* Desktop navigation shown on top */
.rg-top-nav { display: none; align-items: center; gap: 8px; }
@media (min-width: 900px) { .rg-top-nav { display: flex; } }
.rg-top-nav a {
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 12px;
    transition: color .2s, background .2s;
}
.rg-top-nav a:hover, .rg-top-nav a.active { color: #fff; background: var(--bg-elevated); }

/* ===== Floating Community Button ===== */
.rg-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff8533 0%, var(--accent) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px var(--accent-glow);
    cursor: pointer;
    z-index: 40;
    border: none;
    transition: transform .15s;
}
.rg-fab:hover { transform: scale(1.05); }
.rg-fab:active { transform: scale(0.96); }
.rg-fab .dot {
    position: absolute; top: 6px; right: 8px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #ef4444; border: 2px solid var(--bg-primary);
}
@media (max-width: 768px) {
    .rg-fab { right: 16px; bottom: 90px; width: 54px; height: 54px; }
}

/* ===== Container / Layout ===== */
.rg-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex; flex-direction: column;
    gap: 18px;
}

/* ===== Form ===== */
.rg-input, .rg-select, .rg-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.rg-input:focus, .rg-select:focus, .rg-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.rg-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.rg-form-group { margin-bottom: 16px; }

/* PIN UI */
.rg-pin-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.rg-pin-inputs input {
    width: 48px; height: 56px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-light);
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
}
.rg-pin-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ===== Auth Card ===== */
.rg-auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 30px 20px;
    position: relative;
}
.rg-auth-card {
    width: 100%; max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
}
.rg-auth-card h1 { font-size: 26px; margin: 20px 0 6px; font-weight: 800; letter-spacing: -0.02em; }
.rg-auth-card p.sub { color: var(--text-secondary); margin: 0 0 24px; }

/* ===== Toast ===== */
.rg-toast-wrap {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
    width: 90%; max-width: 420px;
}
.rg-toast {
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 12px;
    animation: slideDown .3s ease-out;
    pointer-events: auto;
}
.rg-toast.success { border-color: var(--success); }
.rg-toast.error { border-color: var(--danger); }
.rg-toast.warning { border-color: var(--warning); }
.rg-toast.info { border-color: var(--info); }
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Utility ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #252530; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #333344; }

/* Router visual (pure CSS/SVG fallback) */
.rg-hero-right { flex: 1; position: relative; min-height: 280px; display: flex; align-items: center; justify-content: flex-end; }
