/* ===============================
   PAGAMENTO.CSS - Tela de Assinatura OHMYBOX
   =============================== */

body {
    background-color: #f9f9f9;
    font-family: 'Poppins', sans-serif;
    color: #333;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* --- MAIN: reduzido topo e removido padding inferior --- */
main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px 0; /* remove padding-bottom totalmente */
}

/* --- CARD PRINCIPAL --- */
.checkout-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 40px 50px;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto 10px; /* margem inferior bem reduzida */
    box-sizing: border-box;
    overflow: hidden;
}

/* --- TÍTULO CENTRALIZADO --- */
.checkout-title {
    text-align: center;
    font-size: 1.7rem;
    font-weight: 700;
    color: #f40a45;
    margin-bottom: 35px;
    text-transform: uppercase;
    letter-spacing: -0.3px;
    border-bottom: 2px solid #f40a45;
    display: inline-block;
    padding-bottom: 8px;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* --- CONTAINER DE DUAS COLUNAS --- */
.container,
.columns {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.columns .left,
.columns .right,
.checkout-card .left,
.checkout-card .right {
    flex: 1;
    min-width: 320px;
}

/* --- TÍTULOS INTERNOS --- */
.checkout-card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #222;
    margin: 25px 0 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* --- CAMPOS DO FORM --- */
.group {
    position: relative;
    margin-bottom: 20px;
}

.group input {
    width: 100%;
    padding: 14px 12px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Realce ao focar */
.group input:focus {
    border-color: #f40a45;
    box-shadow: 0 0 0 3px rgba(244, 10, 69, 0.12);
    outline: none;
}

/* --- LABEL FLOATING --- */
.group label {
    position: absolute;
    top: 14px;
    left: 14px;
    color: #777;
    font-size: 0.9rem;
    background: #fff;
    padding: 0 5px;
    pointer-events: none;
    transition: all 0.15s ease-in-out;
    line-height: 1;
    z-index: 1;
}

.group input:focus + label,
.group input:valid + label,
.group input.has-value + label {
    top: -9px;
    left: 10px;
    font-size: 0.75rem;
    color: #f40a45;
    background-color: #fff;
    z-index: 2;
}

/* --- Controle alternativo via .group.filled (JS) --- */
.group.filled label {
    top: -9px;
    left: 10px;
    font-size: 0.75rem;
    color: #f40a45;
    background-color: #fff;
    z-index: 2;
}

/* --- Label obrigatório --- */
.group label span {
    color: red;
    margin-left: 2px;
}

/* Inputs desabilitados */
.group input:disabled {
    background: #f7f7f7;
    color: #999;
    cursor: not-allowed;
}

/* --- CAMPOS EM DUAS COLUNAS --- */
.w50 {
    display: flex;
    gap: 15px;
}

/* --- SWITCH / CHECKBOX --- */
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.switch input {
    display: none;
}

.switch .slider {
    width: 45px;
    height: 22px;
    background-color: #ccc;
    border-radius: 30px;
    position: relative;
    transition: background-color 0.3s ease;
}

.switch .slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: #fff;
    transition: transform 0.3s ease;
}

.switch input:checked + .slider {
    background-color: #f40a45;
}

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

.switch p {
    font-size: 0.9rem;
    color: #444;
    margin: 0;
}

/* --- FRETE --- */
.groupFrete {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.groupFrete label {
    cursor: pointer;
    font-weight: 600;
    color: #000;
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
}

.groupFrete label:hover {
    background: #fff3f6;
}

.groupFrete input[type="radio"] {
    margin-right: 8px;
}

/* --- ALERTAS --- */
.alert {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    padding: 1rem;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    text-align: center;
}

/* --- BOTÃO PAGAMENTO --- */
.checkout-submit {
    display: flex;
    justify-content: center;
    margin-top: 45px;
    width: 100%;
}

.checkout-submit button {
    background: linear-gradient(135deg, #f40a45, #ff5277);
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: 16px 48px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.checkout-submit button:hover {
    background: linear-gradient(135deg, #ff698b, #73E6DF);
    color: #111;
    transform: scale(1.04);
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    main {
        padding: 35px 20px 0;
    }

    .checkout-card {
        padding: 35px 30px;
        margin-top: 15px;
        margin-bottom: 10px;
    }
    
    .checkout-title {
        font-size: 1.5rem;
    }
    
}

@media (max-width: 768px) {
    main {
        padding: 25px 15px 0;
    }

    .checkout-card {
        padding: 25px 20px;
        margin: 10px auto 5px;
    }

    .w50 {
        flex-direction: column;
        gap: 10px;
    }

    .checkout-title {
        font-size: 1.4rem;
        margin-bottom: 25px;
    }
}

/* =========================================================
   🔹 VALIDAÇÃO E ERROS PERSONALIZADOS
   ========================================================= */
.input-error {
    border-color: #f40a45 !important;
    box-shadow: 0 0 0 3px rgba(244, 10, 69, 0.12) !important;
}

.group.error label {
    color: #f40a45;
    z-index: 2;
}

.error-msg {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #d93025;
    font-weight: 500;
    line-height: 1.3;
}

.group.error input {
    border-color: #f40a45;
    box-shadow: 0 0 0 3px rgba(244, 10, 69, 0.12);
}

.group.filled label {
    top: -9px;
    left: 10px;
    font-size: 0.75rem;
    color: #f40a45;
    background-color: #fff;
    z-index: 2;
}

.group label.floating {
    top: -9px !important;
    left: 10px !important;
    font-size: 0.75rem !important;
    color: #f40a45 !important;
    background-color: #fff !important;
    z-index: 3 !important;
}

.group.error label.floating {
    color: #f40a45 !important;
}
