@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.mp-header {
    background: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 24px;
}

.mp-header-inner {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-logo-img { width: 140px; height: auto; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 4px;
    background: #e8e8e8;
}

.progress-bar-inner {
    height: 100%;
    background: #009ee3;
    transition: width 0.3s ease;
    width: 0;
}

/* ===== LAYOUT ===== */
.checkout-layout {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: flex;
    gap: 24px;
    align-items: start;
}

.col-left { flex: 1; min-width: 0; }

.col-right {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    padding-top: 49px;
}

/* ===== STEPS ===== */
.step { display: none; }
.step.active { display: block; }

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.step-title-main {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.2;
}

.step-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* ===== CARD ===== */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.card-body {
    padding: 24px;
}

/* ===== LISTA DE METODOS ===== */
.method-list {
    list-style: none;
}

.method-item {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    cursor: pointer;
    transition: background 0.1s;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.method-item:last-child {
    border-bottom: none;
}

.method-item:hover {
    background: #fafafa;
}

.method-icon {
    width: 40px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.method-icon svg {
    width: 100%;
    height: 100%;
}

.method-info { flex: 1; }

.method-name {
    font-size: 15px;
    font-weight: 400;
    color: #333;
}

.method-sub {
    font-size: 13px;
    color: #999;
    margin-top: 1px;
}

.method-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== FORMULARIO ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px dashed #c5c5c5;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-style: solid;
    border-color: #009ee3;
    box-shadow: 0 0 0 1px #009ee3;
}

.form-group input::placeholder {
    color: #c5c5c5;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Custom select (parcelas) */
.custom-select {
    position: relative;
}

.custom-select-trigger {
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-select-trigger:hover {
    border-color: #009ee3;
}

.custom-select.open .custom-select-trigger {
    border-color: #009ee3;
    box-shadow: 0 0 0 1px #009ee3;
    border-radius: 6px 6px 0 0;
}

.cs-main {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.cs-sub {
    font-size: 13px;
    color: #00a650;
    font-weight: 500;
    margin-right: 8px;
}

.cs-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-select.open .cs-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #009ee3;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
}

.custom-select.open .custom-select-options {
    display: block;
}

.cs-option {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.cs-option:last-child {
    border-bottom: none;
}

.cs-option:hover {
    background: #f5f8ff;
}

.cs-option-main {
    font-size: 15px;
    color: #333;
}

.cs-option-sub {
    font-size: 13px;
    color: #00a650;
    font-weight: 500;
    margin-top: 2px;
}

.cs-option-sub.com-juros {
    color: #999;
    font-weight: 400;
}

/* Input com prefixo (CPF) */
.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px dashed #c5c5c5;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-with-prefix:focus-within {
    border-style: solid;
    border-color: #009ee3;
    box-shadow: 0 0 0 1px #009ee3;
}

.input-prefix {
    padding: 0 12px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    background: #fafafa;
    height: 48px;
    display: flex;
    align-items: center;
    border-right: 1px dashed #c5c5c5;
    flex-shrink: 0;
}

.input-prefix-toggle {
    cursor: pointer;
    user-select: none;
    color: #009ee3;
    font-weight: 600;
}

.input-prefix-toggle:hover {
    background: #f0f0f0;
}

.input-with-prefix input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    height: 48px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group { flex: 1; }
.form-row .form-group.small { flex: 0 0 140px; }

/* MP field (iframes) */
.mp-field {
    height: 48px;
    border: 1px dashed #c5c5c5;
    border-radius: 6px;
    padding: 0 4px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mp-field:focus-within {
    border-style: solid;
    border-color: #009ee3;
    box-shadow: 0 0 0 1px #009ee3;
}

.mp-field iframe {
    width: 100%;
    height: 100%;
}

/* ===== BOTOES STEP ===== */
.step-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn-voltar {
    height: 44px;
    padding: 0 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #009ee3;
    background: #fff;
    border: 1px solid #009ee3;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-voltar:hover {
    background: #f0f8ff;
}

.btn-continuar {
    height: 44px;
    padding: 0 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #009ee3;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-continuar:hover {
    background: #0087c9;
}

.btn-continuar:disabled {
    background: #b5d8ec;
    cursor: not-allowed;
}

/* ===== MENSAGEM DE ERRO ===== */
.msg-erro {
    background: #ffeaea;
    color: #f23d4f;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
    border-left: 3px solid #f23d4f;
}

/* ===== COLUNA DIREITA ===== */
.merchant-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.merchant-logo-img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
}

.merchant-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.payment-details {
    padding: 24px;
}

.payment-details-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.detail-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    flex: 1;
}

.detail-price {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== RESULTADO ===== */
.resultado {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 100;
}

.resultado-inner {
    background: #fff;
    border-radius: 8px;
    padding: 40px 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.resultado-inner.sucesso h2 { color: #00a650; }
.resultado-inner.pendente h2 { color: #f5a623; }

.resultado-inner h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.resultado-inner p {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.id-pagamento {
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}

.pix-qr {
    width: 200px;
    height: 200px;
    margin: 16px auto;
    display: block;
    border-radius: 6px;
}

.pix-copiacola {
    display: flex;
    gap: 8px;
    margin: 12px auto 16px;
    max-width: 360px;
}

.pix-copiacola input {
    flex: 1;
    padding: 10px 12px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
}

.pix-copiacola button {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: #009ee3;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.boleto-barcode {
    font-size: 13px;
    background: #f5f5f5;
    padding: 14px;
    border-radius: 6px;
    word-break: break-all;
    font-family: monospace;
    margin: 8px 0 16px;
}

.btn-boleto {
    display: inline-block;
    padding: 14px 36px;
    background: #009ee3;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .checkout-layout {
        flex-direction: column;
        padding: 16px 12px 32px;
    }

    .col-right {
        width: 100%;
        position: static;
    }

    .step-title-main { font-size: 20px; }
    .step-title { font-size: 18px; }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group.small { flex: auto; }

    .step-buttons {
        flex-direction: column-reverse;
    }

    .btn-voltar, .btn-continuar {
        width: 100%;
    }
}
