:root {
    --navy-deep: #0a1f44;
    --navy-mid: #1a3a6b;
    --navy-light: #2c5282;
    --gold: #d4af37;
    --gold-light: #f0d674;
    --gold-dark: #b8941f;
    --white: #ffffff;
    --gray-light: #f7fafc;
    --gray-mid: #e2e8f0;
    --gray-dark: #64748b;
    --green: #22c55e;
    --green-bg: #f0fdf4;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --orange: #f59e0b;
    --orange-bg: #fffbeb;
    --shadow-sm: 0 2px 8px rgba(10, 31, 68, 0.08);
    --shadow-md: 0 4px 20px rgba(10, 31, 68, 0.12);
    --shadow-lg: 0 8px 40px rgba(10, 31, 68, 0.16);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-light);
    color: var(--navy-deep);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon {
    font-size: 1.75rem;
}

.nav-brand h1 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.nav-brand small {
    color: var(--gold-light);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back,
.btn-logout {
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: transparent;
    color: var(--white);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-back:hover,
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold-light);
    color: var(--gold-light);
    transform: translateY(-2px);
}

/* ==================== MAIN ==================== */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    animation: fadeUp 0.5s ease-out;
}

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

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

/* ==================== STATUS BANNER ==================== */
.status-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border-left: 5px solid var(--gray-mid);
}

.status-banner.trial {
    border-left-color: var(--orange);
}

.status-banner.ativa {
    border-left-color: var(--green);
}

.status-banner.expirada,
.status-banner.cancelada {
    border-left-color: var(--red);
}

.status-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.status-info {
    flex: 1;
}

.status-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.status-info p {
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.trial {
    background: var(--orange-bg);
    color: #92400e;
    border: 1px solid var(--orange);
}

.status-badge.ativa {
    background: var(--green-bg);
    color: #166534;
    border: 1px solid var(--green);
}

.status-badge.expirada,
.status-badge.cancelada {
    background: var(--red-bg);
    color: #991b1b;
    border: 1px solid var(--red);
}

/* ==================== TRIAL PROGRESS ==================== */
.trial-progress {
    background: var(--white);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--navy-deep);
}

.progress-bar {
    height: 10px;
    background: var(--gray-mid);
    border-radius: 50px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.8s ease;
}

.progress-fill.low {
    background: linear-gradient(90deg, var(--red), #f87171);
}

/* ==================== SECTION ==================== */
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--navy-deep);
}

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

.plan-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

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

.plan-card.recommended {
    border-color: var(--gold);
}

.plan-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 0 0 10px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-header {
    padding: 2rem 1.5rem 1rem;
    text-align: center;
}

.plan-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin-bottom: 0.25rem;
}

.plan-header .plan-desc {
    font-size: 0.8rem;
    color: var(--gray-dark);
}

.plan-price {
    text-align: center;
    padding: 0.5rem 1.5rem 1.5rem;
}

.plan-price .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--navy-deep);
    line-height: 1;
}

.plan-price .amount small {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.plan-price .period {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-top: 0.25rem;
}

.plan-price .savings {
    display: inline-block;
    margin-top: 0.5rem;
    background: var(--green-bg);
    color: #166534;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.plan-features {
    padding: 0 1.5rem 1.5rem;
}

.plan-features li {
    list-style: none;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--navy-deep);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--green);
    font-weight: 700;
    flex-shrink: 0;
}

.plan-action {
    padding: 0 1.5rem 1.5rem;
}

.btn-plan {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-plan.primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--white);
    box-shadow: var(--shadow-gold);
}

.btn-plan.primary:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.btn-plan.secondary {
    background: var(--gray-light);
    color: var(--navy-deep);
    border: 2px solid var(--gray-mid);
}

.btn-plan.secondary:hover {
    border-color: var(--gold);
    background: var(--white);
}

.btn-plan:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-plan .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-plan.loading .spinner {
    display: block;
}

.btn-plan.loading span {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== SUBSCRIPTION DETAILS ==================== */
.details-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--gray-mid);
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--gray-dark);
    font-weight: 500;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy-deep);
}

.detail-actions {
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-cancel-sub {
    padding: 0.65rem 1.5rem;
    border: 2px solid var(--red);
    border-radius: 12px;
    background: transparent;
    color: var(--red);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-sub:hover {
    background: var(--red);
    color: var(--white);
}

.btn-cancel-sub:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== RESULT MESSAGES ==================== */
.result-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    animation: fadeUp 0.4s ease-out;
}

.result-message.success {
    background: var(--green-bg);
    border: 2px solid var(--green);
    color: #166534;
}

.result-message.error {
    background: var(--red-bg);
    border: 2px solid var(--red);
    color: #991b1b;
}

.result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-message strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.result-message p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
}

/* ==================== FOOTER ==================== */
.page-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-dark);
    font-size: 0.85rem;
}

/* ==================== NOTIFICATION ==================== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.35);
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 2000;
    animation: notifIn 0.35s ease-out;
}

.notification.error {
    background: linear-gradient(135deg, #e53e3e, #fc8181);
}

@keyframes notifIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

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

@keyframes notifOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

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

    .status-banner {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .status-badge {
        order: -1;
    }

    .details-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1rem;
    }

    .btn-back {
        display: none;
    }

    .plan-price .amount {
        font-size: 2rem;
    }
}

/* Accessibility */
*:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}