/**
 * Hotspot PIX
 * Arquivo: assets/style.css
 */

/* ================================================================
   RESET / BASE
================================================================ */

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #1f2937;
    background: #f3f4f6;
}

body {
    margin: 0;
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}


/* ================================================================
   FORMULÁRIOS
================================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea,
.admin-search input,
.pix-copy-section textarea {
    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;
    color: #111827;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.admin-search input:focus,
.pix-copy-section textarea:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.12);
}

.form-group-small {
    max-width: 170px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.field-help {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.optional {
    color: #9ca3af;
    font-weight: 400;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    color: #4b5563;
    font-size: 14px;

    cursor: pointer;
}

.checkbox-line input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 8px 0;
}


/* ================================================================
   BOTÕES
================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 42px;

    padding: 9px 16px;

    border: 0;
    border-radius: 8px;

    font-weight: 700;
    font-size: 13px;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        background 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-success {
    background: #059669;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background: #047857;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-full {
    width: 100%;
}

.btn-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}


/* ================================================================
   MENSAGENS
================================================================ */

.form-message {
    margin-bottom: 18px;
    padding: 12px 14px;

    border-radius: 8px;

    font-size: 14px;
    line-height: 1.45;
}

.form-message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert {
    padding: 15px;

    border-radius: 9px;

    font-size: 14px;
}

.alert p {
    margin: 5px 0 0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}


/* ================================================================
   PORTAL
================================================================ */

.portal-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: 28px 16px;

    background:
        linear-gradient(
            180deg,
            #eff6ff 0%,
            #f8fafc 60%,
            #f3f4f6 100%
        );
}

.portal-container {
    width: 100%;
    max-width: 520px;
}

.portal-card {
    width: 100%;

    padding: 28px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    box-shadow:
        0 12px 40px
        rgba(15, 23, 42, 0.08);
}

.portal-header {
    text-align: center;
    margin-bottom: 28px;
}

.portal-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 62px;
    height: 42px;

    margin-bottom: 14px;

    padding: 0 13px;

    background: #2563eb;
    color: #ffffff;

    border-radius: 12px;

    font-weight: 800;
    letter-spacing: 0.04em;
}

.portal-header h1 {
    margin-bottom: 7px;

    color: #111827;
    font-size: 25px;
}

.portal-header p {
    margin-bottom: 0;

    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.portal-section {
    margin-bottom: 26px;
}

.portal-section h2 {
    margin-bottom: 14px;

    color: #111827;
    font-size: 16px;
}

.consent-section {
    padding-top: 4px;
}


/* ================================================================
   PLANOS DO PORTAL
================================================================ */

.plans {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.plan-card {
    position: relative;

    display: block;

    padding: 15px;

    border: 2px solid #e5e7eb;
    border-radius: 11px;

    background: #ffffff;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.plan-card:hover {
    border-color: #93c5fd;
}

.plan-card.selected {
    border-color: #2563eb;
    background: #eff6ff;

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.08);
}

.plan-card input[type="radio"] {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.plan-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    align-items: center;
}

.plan-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.plan-name {
    color: #111827;
    font-size: 16px;
}

.plan-duration {
    color: #6b7280;
    font-size: 13px;
}

.plan-speed {
    color: #6b7280;
    font-size: 12px;
}

.plan-price {
    grid-column: 2;
    grid-row: 1 / span 2;

    display: flex;
    align-items: baseline;
    gap: 3px;

    color: #111827;
}

.plan-price span {
    font-size: 12px;
}

.plan-price strong {
    font-size: 22px;
}

.payment-note {
    margin: 12px 0 0;

    text-align: center;

    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}


/* ================================================================
   PIX
================================================================ */

.pix-card {
    max-width: 520px;
}

.payment-summary {
    margin-bottom: 24px;

    padding: 14px 16px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 6px 0;

    font-size: 14px;
}

.summary-row span {
    color: #6b7280;
}

.summary-row strong {
    color: #111827;
}

.payment-value {
    margin-top: 6px;
    padding-top: 12px;

    border-top: 1px solid #e5e7eb;
}

.payment-value strong {
    font-size: 19px;
}

.pix-instructions {
    margin-bottom: 18px;

    text-align: center;

    color: #4b5563;
    font-size: 14px;
}

.qr-container {
    display: flex;
    justify-content: center;

    margin-bottom: 20px;
}

.pix-qrcode {
    width: 260px;
    max-width: 100%;

    padding: 10px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.pix-copy-section {
    margin-bottom: 20px;
}

.pix-copy-label {
    display: block;
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;
}

.pix-copy-section textarea {
    min-height: 92px;

    margin-bottom: 10px;

    resize: none;

    font-size: 12px;
    line-height: 1.4;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 20px;

    padding: 14px;

    background: #eff6ff;
    border-radius: 9px;

    color: #1e40af;
}

.payment-status strong {
    display: block;
    font-size: 14px;
}

.payment-status p {
    margin: 2px 0 0;
    font-size: 12px;
}

.status-spinner {
    width: 22px;
    height: 22px;

    flex: 0 0 22px;

    border: 3px solid #bfdbfe;
    border-top-color: #2563eb;

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.payment-timer {
    margin-top: 12px;

    text-align: center;

    color: #6b7280;
    font-size: 13px;
}

.payment-success,
.payment-expired {
    padding: 18px 0;

    text-align: center;
}

.success-icon,
.expired-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 68px;
    height: 68px;

    margin: 0 auto 15px;

    border-radius: 50%;

    font-size: 32px;
    font-weight: 800;
}

.success-icon {
    background: #d1fae5;
    color: #047857;
}

.expired-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.payment-success h2,
.payment-expired h2 {
    margin-bottom: 8px;
}

.payment-success p,
.payment-expired p {
    color: #6b7280;
}

.connecting-message {
    margin-top: 16px;

    padding: 11px;

    background: #f0fdf4;
    color: #166534;

    border-radius: 8px;

    font-size: 13px;
}


/* ================================================================
   DEBUG LOCAL
================================================================ */

.debug-box {
    margin-top: 22px;

    padding: 12px;

    background: #f9fafb;

    border: 1px dashed #d1d5db;
    border-radius: 8px;

    color: #6b7280;

    font-family: monospace;
    font-size: 11px;

    overflow-wrap: anywhere;
}

.debug-box summary {
    cursor: pointer;
    font-family:
        Inter,
        system-ui,
        sans-serif;
    font-weight: 700;
}

.debug-box div {
    margin-top: 6px;
}


/* ================================================================
   LOGIN ADMIN
================================================================ */

.admin-login-body {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            #111827,
            #1e3a8a
        );
}

.admin-login-container {
    width: 100%;
    max-width: 420px;
}

.admin-login-card {
    padding: 30px;

    background: #ffffff;

    border-radius: 15px;

    box-shadow:
        0 25px 60px
        rgba(0, 0, 0, 0.25);
}

.admin-login-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 42px;

    margin: 0 auto 18px;

    background: #2563eb;
    color: #ffffff;

    border-radius: 11px;

    font-weight: 800;
}

.admin-login-card h1 {
    margin-bottom: 7px;

    text-align: center;

    font-size: 22px;
}

.admin-login-description {
    margin-bottom: 24px;

    text-align: center;

    color: #6b7280;
    font-size: 14px;
}


/* ================================================================
   ADMIN LAYOUT
================================================================ */

.admin-body {
    background: #f3f4f6;
}

.admin-layout {
    display: flex;

    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    z-index: 30;

    display: flex;
    flex-direction: column;

    width: 245px;

    background: #111827;
    color: #ffffff;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 20px 18px;

    border-bottom: 1px solid #1f2937;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 38px;

    flex: 0 0 46px;

    background: #2563eb;

    border-radius: 9px;

    font-weight: 800;
}

.sidebar-header strong {
    display: block;
    font-size: 14px;
}

.sidebar-header small {
    display: block;
    margin-top: 2px;

    color: #9ca3af;
    font-size: 11px;
}

.admin-menu {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;

    padding: 14px 10px;

    overflow-y: auto;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;

    padding: 11px 12px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: #d1d5db;

    text-align: left;
    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.admin-menu-item:hover {
    background: #1f2937;
    color: #ffffff;
}

.admin-menu-item.active {
    background: #2563eb;
    color: #ffffff;
}

.menu-icon {
    width: 22px;

    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 14px;

    border-top: 1px solid #1f2937;
}

.admin-user-info {
    margin-bottom: 12px;
}

.admin-user-info strong {
    display: block;

    font-size: 13px;
}

.admin-user-info small {
    display: block;

    margin-top: 3px;

    color: #9ca3af;

    font-size: 11px;

    overflow-wrap: anywhere;
}

.admin-content {
    width: calc(100% - 245px);
    margin-left: 245px;
}

.admin-topbar {
    position: sticky;
    top: 0;

    z-index: 20;

    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 72px;

    padding: 12px 24px;

    background: rgba(255, 255, 255, 0.95);

    border-bottom: 1px solid #e5e7eb;

    backdrop-filter: blur(8px);
}

.admin-topbar h1 {
    margin-bottom: 2px;

    font-size: 20px;
}

.admin-topbar small {
    color: #6b7280;
}

.sidebar-toggle {
    display: none;

    width: 40px;
    height: 40px;

    border: 0;
    border-radius: 8px;

    background: #f3f4f6;

    font-size: 20px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-left: auto;

    color: #6b7280;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;

    background: #9ca3af;

    border-radius: 50%;
}

.system-status.online .status-dot {
    background: #10b981;
}

.system-status.online {
    color: #047857;
}

.admin-main {
    padding: 24px;
}

.admin-page {
    display: none;
}

.admin-page.active {
    display: block;
}


/* ================================================================
   DASHBOARD
================================================================ */

.dashboard-cards {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 20px;
}

.dashboard-card {
    padding: 18px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 11px;

    box-shadow:
        0 3px 12px
        rgba(15, 23, 42, 0.03);
}

.dashboard-label {
    display: block;

    margin-bottom: 8px;

    color: #6b7280;
    font-size: 12px;
}

.dashboard-value {
    display: block;

    color: #111827;

    font-size: 25px;
}


/* ================================================================
   PAINÉIS
================================================================ */

.admin-panel {
    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 11px;

    overflow: hidden;
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 70px;

    padding: 16px 18px;

    border-bottom: 1px solid #e5e7eb;
}

.admin-panel-header h2 {
    margin-bottom: 3px;

    font-size: 16px;
}

.admin-panel-header p {
    margin-bottom: 0;

    color: #6b7280;
    font-size: 12px;
}

.admin-panel form,
.settings-info {
    padding: 18px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 20px;
}


/* ================================================================
   TABELAS
================================================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;

    border-collapse: collapse;

    white-space: nowrap;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;

    border-bottom: 1px solid #f0f1f3;

    text-align: left;
    vertical-align: middle;

    font-size: 12px;
}

.admin-table th {
    background: #f9fafb;

    color: #6b7280;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.admin-table tbody tr:hover {
    background: #fafafa;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-empty {
    padding: 24px !important;

    text-align: center !important;

    color: #9ca3af;
}

.table-subtext {
    display: block;

    margin-top: 3px;

    color: #9ca3af;
}

.table-txid {
    max-width: 150px;
}

.mono {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 11px !important;
}


/* ================================================================
   BADGES
================================================================ */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 7px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-muted {
    background: #e5e7eb;
    color: #4b5563;
}


/* ================================================================
   BUSCA
================================================================ */

.leads-header {
    flex-wrap: wrap;
}

.admin-search {
    display: flex;
    gap: 8px;
}

.admin-search input {
    width: 280px;
}


/* ================================================================
   LISTAS ADMIN
================================================================ */

.plans-admin-list,
.routers-admin-list {
    display: flex;
    flex-direction: column;

    padding: 12px;
}

.admin-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 13px;

    border-bottom: 1px solid #f0f1f3;
}

.admin-list-card:last-child {
    border-bottom: 0;
}

.admin-list-card-main {
    display: flex;
    flex-direction: column;
    gap: 3px;

    min-width: 0;
}

.admin-list-card-main strong {
    font-size: 14px;
}

.admin-list-card-main span {
    color: #4b5563;
    font-size: 12px;
}

.admin-list-card-main small {
    color: #9ca3af;
    font-size: 11px;
}

.admin-list-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;

    flex: 0 0 auto;
}


/* ================================================================
   EFÍ / CONFIGURAÇÕES
================================================================ */

.settings-info label {
    display: block;

    margin: 18px 0 6px;

    color: #374151;

    font-size: 13px;
    font-weight: 600;
}

.settings-info label:first-child {
    margin-top: 0;
}

.code-box {
    padding: 11px;

    background: #111827;
    color: #e5e7eb;

    border-radius: 7px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        monospace;

    font-size: 11px;

    overflow-wrap: anywhere;
}

.webhook-note {
    margin: 18px 0;

    padding: 14px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    font-size: 13px;
}

.webhook-note strong {
    display: block;
    margin-bottom: 5px;
}

.webhook-note p {
    margin: 0;

    color: #6b7280;
    line-height: 1.5;
}


/* ================================================================
   RESPONSIVO - TABLET
================================================================ */

@media (max-width: 1100px) {

    .dashboard-cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}


/* ================================================================
   RESPONSIVO - ADMIN MOBILE
================================================================ */

@media (max-width: 820px) {

    .admin-sidebar {
        transform: translateX(-100%);

        transition:
            transform 0.2s ease;

        box-shadow:
            12px 0 30px
            rgba(0, 0, 0, 0.18);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-content {
        width: 100%;
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-topbar {
        padding: 10px 14px;
    }

    .admin-main {
        padding: 15px;
    }

    .system-status {
        font-size: 0;
    }

    .system-status .status-dot {
        width: 10px;
        height: 10px;
    }

    .admin-search {
        width: 100%;
    }

    .admin-search input {
        width: 100%;
    }
}


/* ================================================================
   RESPONSIVO - CELULAR
================================================================ */

@media (max-width: 600px) {

    .portal-body {
        padding: 0;
        background: #ffffff;
    }

    .portal-container {
        max-width: none;
    }

    .portal-card {
        min-height: 100vh;

        padding: 22px 17px;

        border: 0;
        border-radius: 0;

        box-shadow: none;
    }

    .portal-header {
        margin-bottom: 24px;
    }

    .portal-header h1 {
        font-size: 22px;
    }

    .plan-content {
        grid-template-columns: 1fr auto;
    }

    .plan-price strong {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group-small {
        max-width: none;
    }

    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-value {
        font-size: 20px;
    }

    .admin-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-list-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-list-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .admin-login-body {
        padding: 0;

        background: #ffffff;
    }

    .admin-login-container {
        max-width: none;
    }

    .admin-login-card {
        min-height: 100vh;

        padding: 28px 20px;

        border-radius: 0;

        box-shadow: none;
    }
}


/* ================================================================
   TELAS MUITO PEQUENAS
================================================================ */

@media (max-width: 380px) {

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .plan-content {
        grid-template-columns: 1fr;
    }

    .plan-price {
        grid-column: 1;
        grid-row: auto;

        margin-top: 7px;
    }
}