/**
 * B2B Banco de Licenças - Styles
 * Version: 2.1
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.b2b-login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.login-container {
    animation: fadeIn 0.6s ease-out;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.logo-icon svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.login-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-container h1 span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 15px;
    color: #718096;
    font-weight: 400;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    color: #2d3748;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #cbd5e0;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.error-msg {
    background: linear-gradient(135deg, #fc5c7d, #e74c3c);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s;
}

.error-msg::before {
    content: '⚠';
    font-size: 18px;
}

.footer-text {
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    color: #718096;
}

/* ==========================================================================
   Panel/Dashboard Styles (fullscreen / largura total em /painel)
   ========================================================================== */
html body.b2b-panel-page,
body.b2b-panel-page {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
}

.b2b-panel-page {
    background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
    color: #1e293b;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.dash-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
}

.top-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.25);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.brand-logo svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide Sair button on desktop */
.btn-logout {
    display: none;
}

/* ==========================================================================
   Header Menu (Download, Suporte, Personalizar)
   ========================================================================== */
/* ==========================================================================
   Header Menu (Download, Suporte, Personalizar)
   ========================================================================== */
.header-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    /* Alinhado à direita */
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    backdrop-filter: blur(5px);
}

.menu-btn:hover {
    background: #fff;
    color: #667eea;
    border-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Estilos específicos para Download e WhatsApp abaixo */

.menu-btn.download {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
}

.menu-btn.download:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.menu-btn.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: none;
    color: #fff;
}

.menu-btn.whatsapp:hover {
    background: linear-gradient(135deg, #128c7e, #0e6b5e);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

/* Sair button styling - same identity */
.menu-btn.menu-logout {
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.menu-btn.menu-logout:hover {
    background: #fff;
    color: #ef4444 !important;
    /* Vermelho no hover para indicar saída */
    border-color: #fff !important;
}

/* Seção de menu toggle removida */

/* Mobile Styles */
@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
        /* Centraliza no mobile se quebrar linha */
    }

    .header-menu {
        /* Garante que o menu apareça e possa quebrar linha se necessário */
        display: flex;
        width: 100%;
        justify-content: center;
        /* Centraliza botões no mobile */
        margin-top: 10px;
    }

    .header-menu .menu-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        box-shadow: none;
    }

    .header-menu .menu-btn:not(.download):not(.whatsapp):not(.menu-logout) {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: #fff;
    }

    /* Show Sair in mobile menu */
    .menu-btn.menu-logout {
        display: flex;
        order: 99;
    }

    .top-header {
        position: relative;
    }

    .user-info,
    .user-avatar {
        display: none;
    }
}

/* ==========================================================================
   Notice Carousel (Avisos)
   ========================================================================== */
.notice-carousel {
    background: #fffbeb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 22px;
    border: 1px solid #fde68a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notice-text {
    flex: 1;
    min-width: 0;
}

.notice-title {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 2px;
}

.notice-message {
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

.notice-nav {
    flex-shrink: 0;
}

.notice-dots {
    display: flex;
    gap: 8px;
}

.notice-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(120, 53, 15, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.notice-dot.active {
    background: #92400e;
    transform: scale(1.2);
}

.notice-dot:hover {
    background: #92400e;
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-box {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.stat-box.balance .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-box.licenses .stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-box.used .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-number {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-box.balance .stat-number {
    color: #667eea;
}

.stat-box.licenses .stat-number {
    color: #10b981;
}

.stat-box.used .stat-number {
    color: #f59e0b;
}

.stat-text {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* ==========================================================================
   Action Cards
   ========================================================================== */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.action-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 20px;
    height: 20px;
    fill: #667eea;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-field {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.field-input,
.field-select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    background: #fff;
}

.field-input:focus,
.field-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 11px 24px;
    border: 1px solid #fff !important;
    /* Adicionando borda branca conforme solicitado */
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    color: #fff !important;
    /* Texto branco forçado */
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff !important;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-full {
    width: 100%;
}

.price-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

/* ==========================================================================
   Full Width Cards
   ========================================================================== */
.full-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.grid-4col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table thead {
    background: #f8fafc;
    border-radius: 8px;
}

.data-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #1e293b;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-suspended {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

/* ==========================================================================
   Links
   ========================================================================== */
.link-action {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.3s;
}

.link-action:hover {
    color: #764ba2;
}

.link-danger {
    color: #ef4444;
}

.link-danger:hover {
    color: #dc2626;
}

.link-success {
    color: #10b981;
}

.link-success:hover {
    color: #059669;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #fff;
    padding: 32px;
    border-radius: 18px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px 8px;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.qr-area {
    text-align: center;
    margin: 16px 0;
}

.qr-area img {
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-text {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    word-break: break-all;
    font-size: 11px;
    font-family: monospace;
    margin: 16px 0;
    border: 1.5px dashed #cbd5e1;
    max-height: 80px;
    overflow-y: auto;
}

.amount-info {
    font-size: 15px;
    color: #475569;
    margin: 16px 0;
    text-align: center;
}

.amount-info strong {
    font-size: 22px;
    color: #667eea;
    display: block;
    margin-top: 4px;
}

.license-code {
    background: #f8fafc;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    color: #475569;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 968px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }

    .grid-4col {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .dash-container {
        padding: 16px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .modal-box {
        padding: 24px;
    }

    .qr-area img {
        max-width: 240px;
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .user-section {
        width: 100%;
        justify-content: space-between;
    }

    .btn-logout {
        width: 100%;
        margin-top: 8px;
    }

    .top-header {
        padding: 16px;
    }

    .login-container {
        padding: 40px 30px;
    }

    .login-container h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }
}

/* ==========================================================================
   Shortcode Specific Styles (for embedded login)
   ========================================================================== */
.b2b-login-shortcode {
    max-width: 420px;
    margin: 50px auto;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.b2b-login-shortcode .logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.b2b-login-shortcode .logo-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b2b-login-shortcode h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.b2b-login-shortcode h2 span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.b2b-login-shortcode .form-field {
    margin-bottom: 22px;
}

.b2b-login-shortcode .field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.b2b-login-shortcode .field-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}

.b2b-login-shortcode .btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}