/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    background: white; 
    color: #333; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    min-height: 100vh; 
}

/* ============================================================================
   LAYOUT STRUCTURE
   ============================================================================ */
.topbar {
    background: #022147;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo-placeholder {
    width: 180px; 
    height: 60px; 
    background: transparent;/*rgba(255,255,255,0.1); */
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    font-weight: bold; 
    font-size: 0.9rem;
}

.main-content {
    max-width: 800px; 
    margin: 2rem auto; 
    padding: 0 1rem;
    /* Removed padding-bottom: 100px */
}

/* ============================================================================
   STEP HEADERS (Tab Navigation)
   ============================================================================ */
.tab-headers {
    display: flex; 
    gap: 0; 
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab-header {
    flex: 1; 
    padding: 1rem 0; 
    text-align: center;
    background: none; 
    border: none; 
    font-size: 0.95rem; 
    font-weight: 500;
    color: #6b7280; 
    cursor: pointer; 
    position: relative;
}

.tab-header.active {
    color: #1e3a8a; 
    font-weight: 600;
}

.tab-header.active::after {
    content: ''; 
    position: absolute; 
    bottom: -2px; 
    left: 0; 
    right: 0;
    height: 2px; 
    background: #1e3a8a;
}

/* ============================================================================
   TAB CONTENT VISIBILITY
   ============================================================================ */
.tab-content {
    display: none; 
    min-height: 400px; 
    padding: 2rem 0;
}

.tab-content.active { 
    display: block; 
}


/* ============================================================================
   STEP 1: PLAN SELECTION LAYOUT
   ============================================================================ */
.plan-container {
    display: flex; 
    gap: 2rem; 
    max-width: 800px; 
    margin: 0 auto 2rem;
}

.plan-list {
    flex: 1; 
    max-width: 450px;
}

.plan-radio {
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    padding: 1.5rem 0; 
    position: relative; 
    padding-left: 2.5rem;
}

.plan-radio input[type="radio"] {
    position: absolute; 
    opacity: 0;
}

.radio-circle {
    width: 20px; 
    height: 20px; 
    border: 2px solid #e5e7eb; 
    border-radius: 50%; 
    margin-right: 1rem; 
    position: relative;
    flex-shrink: 0;
}

.plan-radio input:checked + .radio-circle {
    border-color: #1e3a8a; 
    background: #1e3a8a;
}

.plan-radio input:checked + .radio-circle::after {
    content: ''; 
    position: absolute; 
    top: 50%; 
    left: 50%;
    width: 8px; 
    height: 8px; 
    background: white;
    border-radius: 50%; 
    transform: translate(-50%, -50%);
}

.plan-info { flex: 1; }
.plan-name { 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin-bottom: 0.25rem; 
}
.plan-desc { 
    color: #6b7280; 
    margin-bottom: 0.5rem; 
}

.plan-spacing { height: 1rem; }
.divider { 
    border: none; 
    border-top: 1px solid #e5e7eb; 
    margin: 1rem 0;
}

/* ============================================================================
   PLAN PREVIEW (Right Panel - Step 1 & 3)
   ============================================================================ */
.selected-preview {
    flex: 0 0 250px; 
    background: #f8fafc; 
    padding: 2rem; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    text-align: center;
}

.preview-title { 
    font-size: 1rem; 
    color: #6b7280; 
    margin-bottom: 1rem; 
    font-weight: 500;
}

.selected-plan { 
    font-size: 1.3rem; 
    font-weight: 600; 
    color: #1f2937; 
    margin-bottom: 0.5rem;
}

.selected-price { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #1e3a8a;
}

.no-selection { 
    color: #9ca3af; 
    font-style: italic; 
    margin-top: 2rem;
}

/* ============================================================================
   STEP 2: FORM INPUTS
   ============================================================================ */
.form-group { 
    margin-bottom: 1.5rem; 
}

.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 500; 
    color: #374151; 
}

.form-group input { 
    width: 100%; 
    padding: 0.75rem 1rem; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    font-size: 1rem; 
}

.form-group input:focus { 
    outline: none; 
    border-color: #1e3a8a; 
    box-shadow: 0 0 0 3px rgba(30,58,138,0.1); 
}

/* ============================================================================
   FORM GRID VISIBILITY
   ============================================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.form-group.full-width {
    grid-column: 1 / -1;  /* Full width for specific fields */
}

.form-group input[name="expiry"] {
    font-family: 'Courier New', monospace;  /* Fixed width digits */
    letter-spacing: 0.1em;
}

/* ============================================================================
   BUTTONS - STEP 1 (Standalone Avançar)
   ============================================================================ */
.avancar-btn {
    background: #1e3a8a; 
    color: white; 
    border: none;
    padding: 1rem 2rem; 
    border-radius: 12px; 
    font-size: 1.1rem; 
    font-weight: 600;
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(30,58,138,0.3);
    display: block;
    width: 100%;
    margin-top: 2rem;
}

.avancar-btn:hover { background: #1e40af; }

/* ============================================================================
   BUTTONS - STEP 2 & 3 (Side-by-side)
   ============================================================================ */
.button-group {
    display: flex; 
    gap: 1rem; 
    margin-top: 2rem;
    width: 100%;
}

.button-group .avancar-btn,
.button-group .return-btn,
.button-group .finalizar-btn {
    flex: 1;
    padding: 1rem 2rem; 
    border-radius: 12px; 
    font-size: 1.1rem; 
    font-weight: 600;
    border: none;
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(30,58,138,0.3);
    margin: 0 !important;
}

.button-group .avancar-btn,
.button-group .finalizar-btn {
    background: #1e3a8a !important; 
    color: white !important;
}

.button-group .avancar-btn:hover,
.button-group .finalizar-btn:hover { 
    background: #1e40af !important; 
}

.button-group .return-btn {
    background: #6b7280 !important; 
    color: white !important;
}

.button-group .return-btn:hover { 
    background: #4b5563 !important; 
}

/* ============================================================================
   BOTTOM INFO BAR (Always Below Content)
   ============================================================================ */
.bottom-info-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 3rem;      /* Space above bar */
    width: 100%;
}

.bottom-info-bar .main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bottom-info-bar p {
    margin: 0;
    text-align: center;
}

.bottom-info-bar strong {
    color: #1e3a8a;
}

/* ============================================================================
   PIX PAYMENT STEP
   ============================================================================ */
.pix-container { max-width: 500px; margin: 2rem auto; text-align: center; }
.pix-qrcode img { max-width: 250px; margin: 1rem 0; }
.pix-details { background: #f8fafc; padding: 1.5rem; border-radius: 12px; margin: 1rem 0; }

/* ============================================================================
   CARD PAYMENT STEP
   ============================================================================ */
.card-form-container { max-width: 600px; margin: 2rem auto; padding: 2rem; }
.card-form-container h1 { text-align: center; margin-bottom: 2rem; color: #1e3a8a; }
.card-title { text-align: center; margin-bottom: 2rem; color: #1e3a8a; font-size: 1.8rem; }
.error { background: #fef2f2; color: #dc2626; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid #fecaca; }

.success-container {
    max-width: 500px; 
    margin: 2rem auto; 
    text-align: center; 
    padding: 2rem;
}

.success-icon {
    font-size: 4rem; 
    margin-bottom: 1rem;
}

.payment-details {
    background: #f0fdf4; 
    border: 1px solid #bbf7d0; 
    border-radius: 12px; 
    padding: 1.5rem; 
    margin: 2rem 0;
}

.payment-details p {
    margin: 0.75rem 0; 
    font-size: 1.1rem;
}

.payment-details strong {
    color: #166534;
}

.success-title {
    text-align: center;
    margin: 1rem 0 2rem 0;
    color: #166534;
    font-size: 1.8rem;
}

.button-link {
    display: inline-block;
    text-decoration: none;
    line-height: 1.5;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .topbar { padding: 1rem; }
    .main-content { margin: 1rem auto; padding: 0 1rem; }
    .plan-container { flex-direction: column; }
    .selected-preview { order: -1; }
    .button-group { 
        flex-direction: column; 
        gap: 0.5rem; 
    }
}
