/* FollowBoost - Modern Checkout System CSS */

/* === ANIMAÇÕES === */
@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* === ETAPAS DO CHECKOUT === */
.checkout-step {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
    background: var(--gradient-card);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.checkout-step.active {
    display: block;
}

/* === HEADER DAS ETAPAS === */
.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.step-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.step-header h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(-3px);
    box-shadow: var(--shadow-md);
}

/* === GRID DE PRODUTOS === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.product-card {
    background: var(--gradient-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card.selected {
    border-color: var(--primary-color) !important;
    background: var(--bg-tertiary) !important;
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-xl), var(--shadow-glow) !important;
}

.product-card.selected::before {
    transform: scaleX(1) !important;
}

.product-card.selected::after {
    content: "✓";
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    animation: pulse 1.5s infinite;
}

.product-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-quantity {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.product-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin: 1.5rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-features li {
    padding: 0.6rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-features li::before {
    content: "✓";
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === FORMULÁRIO MELHORADO === */
.checkout-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--gradient-card);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.checkout-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.label-icon {
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}

.form-label small {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 1.2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23a1a1aa" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5rem;
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.conditional-field {
    display: none;
    margin-bottom: 2rem;
    animation: slideIn 0.3s ease-out;
}

.conditional-field.active {
    display: block;
}

/* === ESTADOS DE VALIDAÇÃO === */
.form-input.error {
    border-color: var(--danger-color) !important;
    background: rgba(239, 68, 68, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
    animation: glow 1s ease-in-out;
}

.form-input.valid {
    border-color: var(--success-color) !important;
    background: rgba(34, 197, 94, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1) !important;
}

/* === MENSAGENS DE ERRO === */
.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 0.8rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    display: none;
    font-weight: 500;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.error-message.show {
    display: block;
}

/* === RESUMO DO PEDIDO MELHORADO === */
.order-summary {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-quaternary) 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.order-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.order-summary h3, .order-summary h4 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    padding: 0.5rem 0;
}

.summary-item span:first-child {
    font-weight: 600;
}

.summary-item span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-item.features {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.summary-item.features ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.summary-item.features li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-item.features li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem -1rem 0;
}

.summary-total span:last-child {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === BOTÕES MELHORADOS === */
.checkout-btn {
    width: 100%;
    padding: 1.4rem;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.checkout-btn:hover::before {
    left: 100%;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.checkout-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.checkout-btn:disabled::before {
    display: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* === SEÇÃO DE PAGAMENTO === */
.payment-container {
    text-align: center;
    background: var(--gradient-card);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
}

.payment-loading {
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: var(--shadow-md);
}

.qr-code-section {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.qr-code-section h4 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-code-container {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    display: inline-block;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.qr-code-container img {
    max-width: 250px;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.payment-info {
    margin-top: 2rem;
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.payment-info p {
    margin: 1rem 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-info strong {
    color: var(--text-primary);
    font-weight: 700;
}

.expiry-info {
    color: var(--danger-color) !important;
    font-weight: 700 !important;
}

.payment-status {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 2rem 0;
}

.status-checking {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pulse-dot {
    width: 24px;
    height: 24px;
    background: var(--warning-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.status-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warning-color);
    margin: 0;
}

.status-subtext {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

.payment-error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
}

.payment-error h4 {
    color: var(--danger-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* === TELA DE SUCESSO === */
.success-container {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--gradient-card);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--success-color);
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.6s ease-out;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.success-container h3 {
    color: var(--success-color);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.success-container p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.order-details {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 2.5rem 0;
}

.order-details h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.order-detail-item:last-child {
    margin-bottom: 0;
}

.order-detail-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.next-steps {
    text-align: left;
    max-width: 450px;
    margin: 2.5rem auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.next-steps h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.next-steps ul {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 1.5rem;
}

.next-steps li {
    margin-bottom: 0.8rem;
}

/* === STATUS BADGES === */
.status-badge {
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-processando {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.status-concluido {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-pendente {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

/* === ESTADOS ESPECIAIS === */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
    height: 20px;
    margin: 0.5rem 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .checkout-step {
        margin: 1rem;
        padding: 2rem;
    }
    
    .step-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .step-header h3 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .checkout-form {
        padding: 2rem;
        margin: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-price {
        font-size: 1.7rem;
    }
    
    .payment-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .qr-code-section {
        padding: 1.5rem;
    }
    
    .qr-code-container img {
        max-width: 200px;
    }
    
    .success-container {
        padding: 2.5rem 1.5rem;
        margin: 1rem;
    }

    .success-icon {
        font-size: 4rem;
    }

    .order-summary {
        padding: 2rem;
        margin-bottom: 2rem;
    }

    .summary-total {
        font-size: 1.3rem;
        margin: 1rem -1rem 0;
    }

    .checkout-btn {
        padding: 1.2rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .checkout-step {
        padding: 1.5rem;
    }

    .step-header h3 {
        font-size: 1.3rem;
    }

    .product-card {
        padding: 1.5rem;
    }

    .checkout-form {
        padding: 1.5rem;
    }

    .order-summary {
        padding: 1.5rem;
    }

    .form-input, .form-select {
        padding: 1rem;
    }

    .qr-code-container {
        padding: 1rem;
    }

    .success-container {
        padding: 2rem 1rem;
    }

    .next-steps {
        padding: 1.5rem;
    }
}