/* ==========================================================================
   Estilos Gerais do Formulário (Wrapper e Títulos)
   ========================================================================== */

.pin-form-wrapper,
.pin-payment-wrapper {
    max-width: 600px;
    margin: 2em auto;
    padding: 2em;
    border: 1px solid #ddd;
    border-radius: 8px;
    /* Um pouco mais suave */
    background: #f9f9f9;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.pin-payment-wrapper {
    max-width: 500px;
    text-align: center;
}

.pin-form-title {
    text-align: center;
    margin-bottom: 1.5em;
    color: #2c3e50;
}

/* ==========================================================================
   Cards de Seleção de Produto
   ========================================================================== */

.pin-product-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    margin-bottom: 2em;
}

.pin-product-card {
    position: relative;
}

.pin-product-card input[type="checkbox"],
.pin-product-card input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pin-product-card label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 1.5em;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* --- CORREÇÃO UX: Estilo unificado para card selecionado --- */
.pin-product-card.selected label {
    border-color: #0073aa;
    background-color: #f0f8ff;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.2);
}

.pin-product-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #34495e;
}

.pin-product-price {
    font-weight: 500;
    color: #555;
}

/* ==========================================================================
   Campos do Formulário (Inputs, Selects, Fieldsets)
   ========================================================================== */

.pin-fieldset {
    border: 1px solid #eee;
    padding: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 4px;
    background: #fff;
}

.pin-fieldset legend {
    font-weight: bold;
    padding: 0 0.5em;
    color: #34495e;
}

.pin-form-row {
    margin-bottom: 1.2em;
}

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

.pin-form-row label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.pin-form-row input[type="text"],
.pin-form-row input[type="email"],
.pin-form-row input[type="date"],
.pin-form-row input[type="url"],
.pin-form-row input[type="number"],
.pin-form-row select,
.pin-form-row textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    /* Garante que o padding não aumente a largura */
}

/* Estilo para quando o usuário clica no campo */
.pin-form-row input:focus,
.pin-form-row select:focus,
.pin-form-row textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.pin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
}

/* ==========================================================================
   Seções Específicas do Formulário (Tipo, Termos, Total)
   ========================================================================== */

.pin-purchase-type {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}

.pin-purchase-type label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    font-weight: 500;
}

.pin-terms-row {
    margin-bottom: 1.5em;
    text-align: center;
}

.pin-terms-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
}

.pin-form-total {
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 1.5em;
}

.pin-form-submit {
    text-align: center;
}

.pin-submit-button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 1em 2em;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pin-submit-button:hover {
    background-color: #005177;
}

.pin-loader {
    font-weight: bold;
}

/* ==========================================================================
   Estilos da Página de Pagamento
   ========================================================================== */

.pin-qr-code img {
    max-width: 100%;
    height: auto;
    width: 250px;
    border: 5px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 1em 0;
}

.pin-pix-copy-paste textarea {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 3px;
    border: 1px solid #ccc;
    resize: none;
    margin-top: 10px;
    text-align: center;
}

#pin-copy-button {
    margin-top: 10px;
}

.pin-waiting-payment {
    margin-top: 2em;
    color: #555;
}

.pin-waiting-payment .spinner {
    float: none;
    vertical-align: middle;
    margin-right: 5px;
}

.pin-notice {
    padding: 1em 2em;
    margin: 2em 0;
    border-radius: 4px;
    border-left-width: 4px;
    border-left-style: solid;
}

.pin-error {
    background: #fbeaea;
    border-color: #dc3232;
}

.pin-info {
    background: #e8f5fb;
    border-color: #00a0d2;
}

/* ==========================================================================
   Estilos do Formulário de Agradecimento
   ========================================================================== */

#pin-thankyou-form .pin-form-title {
    font-size: 24px;
    margin-bottom: 0.5em;
}

#pin-thankyou-form p {
    text-align: center;
    color: #555;
    margin-bottom: 2em;
}

#pin-thankyou-form textarea {
    min-height: 150px;
    font-size: 16px;
    line-height: 1.6;
}

#pin-thankyou-form .pin-submit-button {
    font-size: 1.2em;
    padding: 12px 28px;
}

/* ==========================================================================
   Responsividade para Dispositivos Móveis
   ========================================================================== */

@media (max-width: 600px) {

    .pin-form-wrapper,
    .pin-payment-wrapper {
        padding-left: 15px;
        padding-right: 15px;
        margin-left: 5px;
        margin-right: 5px;
        width: auto;
    }

    .pin-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .pin-fieldset {
        padding: 1.2em;
    }

    .pin-product-card label {
        padding: 0.8em 1em;
    }

    .pin-product-title {
        font-size: 1em;
    }

    .pin-product-price {
        font-size: 0.9em;
    }
}