/* === VARIÁVEIS CSS === */
:root {
    --color-primary: #10b981;        /* Verde esmeralda */
    --color-primary-dark: #065f46;   /* Verde escuro */
    --color-primary-light: #d1fae5;  /* Verde claro */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-600: #6b7280;
    --color-gray-800: #1f2937;
    --color-white: #ffffff;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* body background removido - usando o background global do style.css */

/* === CONTAINER PRINCIPAL === */
.billing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.billing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.billing-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.billing-header p {
    font-size: 1.125rem;
    color: #E0E0E0;
}

/* === TOGGLE MENSAL/ANUAL === */
.billing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.billing-toggle label {
    font-size: 1rem;
    font-weight: 500;
    color: #FFFFFF;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.badge-save {
    color: var(--color-primary);
    font-weight: 700;
}

/* === GRID DE PLANOS === */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* === CARD DE PLANO === */
.plan-card {
    background: var(--color-white);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.plan-card.popular {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.plan-card.popular::before {
    position: absolute;
    top: -12px;
    right: 1rem;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.plan-card.current {
    border-color: var(--color-info);
    background: linear-gradient(135deg, var(--color-white) 0%, #dbeafe 100%);
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

/* Estilo ajustado para os spans dentro do preço */
.plan-price .price-monthly,
.plan-price .price-yearly {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.plan-price span {
    font-size: 1rem;
    color: var(--color-gray-600);
    font-weight: 400;
}

.plan-period {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-bottom: 1.5rem;
    /* Garante que o span 'anual' não quebre a linha se for inline */
    white-space: nowrap; 
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.plan-features li {
    padding: 0.5rem 0;
    color: var(--color-gray-600);
    display: flex;
    align-items: flex-start;
}

.plan-features li::before {
    content: "";
    color: var(--color-primary);
    font-weight: 700;
    margin-right: 0.5rem;
    font-size: 1.25rem;
    flex-shrink: 0; /* Evita que o ícone encolha */
}

.plan-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.plan-btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.plan-btn-primary:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}

.plan-btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.plan-btn-secondary:hover {
    background: var(--color-primary-light);
}

.plan-btn-disabled {
    background: var(--color-gray-300);
    color: var(--color-gray-600);
    cursor: not-allowed;
}

.plan-btn-contact {
    background: var(--color-info);
    color: var(--color-white);
}

.plan-btn-contact:hover {
    background: #2563eb;
}

/* === DASHBOARD DE GERENCIAMENTO === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.dashboard-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.dashboard-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-gray-200);
    padding-bottom: 0.5rem;
}

/* === PLANO ATUAL === */
.current-plan-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-white) 100%);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.current-plan-details h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.current-plan-details p {
    color: var(--color-gray-600);
    margin: 0.25rem 0;
}

.plan-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === BARRAS DE PROGRESSO DE USO === */
.usage-item {
    margin-bottom: 1.5rem;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.usage-label {
    font-weight: 600;
    color: var(--color-gray-800);
}

.usage-count {
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.usage-bar-container {
    width: 100%;
    height: 1rem;
    background: var(--color-gray-200);
    border-radius: 1rem;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 1rem;
    transition: width 0.5s ease;
}

.usage-bar.warning {
    background: var(--color-warning);
}

.usage-bar.danger {
    background: var(--color-danger);
}

/* === TABELA DE PAGAMENTOS === */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.payments-table thead {
    background: var(--color-gray-100);
}

.payments-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    color: var(--color-gray-800);
    border-bottom: 2px solid var(--color-gray-300);
}

.payments-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-gray-200);
    color: var(--color-gray-600);
}

.payments-table tbody tr:hover {
    background: var(--color-gray-100);
}

/* === BADGES DE STATUS === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-succeeded {
    background: var(--color-success);
    color: var(--color-white);
}

.badge-failed {
    background: var(--color-danger);
    color: var(--color-white);
}

.badge-pending {
    background: var(--color-warning);
    color: var(--color-white);
}

.badge-active {
    background: var(--color-info);
    color: var(--color-white);
}

.badge-canceled {
    background: var(--color-gray-600);
    color: var(--color-white);
}

/* === PÁGINA DE SUCESSO === */
.success-container {
    max-width: 600px;
    margin: 4rem auto;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.125rem;
    color: var(--color-gray-600);
    margin-bottom: 2rem;
}

.success-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: left;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === PÁGINA DE CANCELAMENTO === */
.canceled-container {
    max-width: 600px;
    margin: 4rem auto;
    text-align: center;
}

.canceled-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    color: var(--color-gray-600);
}

.canceled-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 1rem;
}

/* === BOTÕES === */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary-light);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* === ALERTAS === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--color-info);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--color-warning);
}

.alert-success {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-left: 4px solid var(--color-success);
}


/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    text-align: center;
}

.faq-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 2rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background: var(--color-white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.faq-question {
    font-weight: 600;
    color: var(--color-gray-800);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.faq-answer {
    color: var(--color-gray-600);
    line-height: 1.6;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .billing-header h1 {
        font-size: 2rem;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .plan-card.popular {
        transform: scale(1);
    }

    .current-plan-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .plan-actions {
        justify-content: center;
    }

    .payments-table {
        font-size: 0.875rem;
    }

    .payments-table th,
    .payments-table td {
        padding: 0.5rem;
    }

    .success-actions,
    .canceled-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .billing-container {
        padding: 1rem 0.5rem;
    }

    .plan-card {
        padding: 1.5rem;
    }

    .dashboard-card {
        padding: 1.5rem;
    }
}

/* Erro de digitação no CSS original '}' extra */