/**
 * Estilos públicos para formularios de donación
 * Acorde al diseño de SomosProvincia.es
 */

/* Colores del sitio */
:root {
    --sp-primary: #d54624;
    --sp-secondary: #1f435a;
    --sp-accent: #e69c1c;
    --sp-light: #fafafa;
    --sp-gray: #9d9ea0;
    --sp-border: #cacfd2;
}

/* Contenedor del formulario */
.sp-donation-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.sp-donation-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Secciones del formulario */
.sp-form-section {
    padding: 30px;
    border-bottom: 1px solid var(--sp-border);
}

.sp-form-section:last-child {
    border-bottom: none;
}

.sp-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--sp-secondary);
    margin: 0 0 20px;
}

/* Botones de monto */
.sp-amount-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sp-amount-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.sp-amount-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.sp-amount-label {
    display: block;
    padding: 15px 20px;
    background: var(--sp-light);
    border: 2px solid var(--sp-border);
    border-radius: 6px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--sp-secondary);
    transition: all 0.3s ease;
}

.sp-amount-option:hover .sp-amount-label {
    border-color: var(--sp-primary);
    background: rgba(213, 70, 36, 0.05);
}

.sp-amount-option input[type="radio"]:checked + .sp-amount-label {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: #fff;
}

/* Input de cantidad personalizada */
.sp-custom-amount-input {
    margin-top: 15px;
}

.sp-custom-amount-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--sp-secondary);
}

.sp-custom-amount-input input {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 2px solid var(--sp-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.sp-custom-amount-input input:focus {
    outline: none;
    border-color: var(--sp-primary);
}

/* Donación recurrente */
.sp-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

.sp-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.sp-recurring-options {
    margin-top: 15px;
    padding: 15px;
    background: var(--sp-light);
    border-radius: 6px;
    display: flex;
    gap: 20px;
}

.sp-recurring-options label {
    cursor: pointer;
    font-size: 15px;
}

.sp-recurring-options input[type="radio"] {
    margin-right: 5px;
}

/* Campos del formulario */
.sp-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.sp-form-field {
    flex: 1;
}

.sp-form-field.sp-field-full {
    width: 100%;
}

.sp-form-field.sp-field-half {
    width: calc(50% - 10px);
}

.sp-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--sp-secondary);
    font-size: 15px;
}

.sp-form-field label .required {
    color: var(--sp-primary);
}

.sp-form-field input[type="text"],
.sp-form-field input[type="email"],
.sp-form-field input[type="tel"],
.sp-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--sp-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.sp-form-field input:focus,
.sp-form-field textarea:focus {
    outline: none;
    border-color: var(--sp-primary);
}

.sp-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Métodos de pago */
.sp-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sp-payment-method {
    cursor: pointer;
    margin: 0;
}

.sp-payment-method input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.sp-payment-label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--sp-light);
    border: 2px solid var(--sp-border);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sp-payment-icon {
    font-size: 24px;
    margin-right: 12px;
}

.sp-payment-method:hover .sp-payment-label {
    border-color: var(--sp-primary);
    background: rgba(213, 70, 36, 0.05);
}

.sp-payment-method input[type="radio"]:checked + .sp-payment-label {
    border-color: var(--sp-primary);
    background: rgba(213, 70, 36, 0.1);
    color: var(--sp-primary);
}

.sp-transfer-info {
    margin-top: 15px;
    padding: 20px;
    background: #f0f8ff;
    border-left: 4px solid var(--sp-primary);
    border-radius: 4px;
}

/* Botón de envío */
.sp-submit-section {
    text-align: center;
}

.sp-submit-button {
    width: 100%;
    max-width: 400px;
    padding: 18px 40px;
    background: var(--sp-primary);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sp-submit-button:hover {
    background: #c13d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(213, 70, 36, 0.3);
}

.sp-submit-button:active {
    transform: translateY(0);
}

.sp-submit-button:disabled {
    background: var(--sp-gray);
    cursor: not-allowed;
    transform: none;
}

.sp-form-note {
    margin-top: 15px;
    font-size: 13px;
    color: var(--sp-gray);
}

/* Mensajes */
.sp-form-messages {
    margin-bottom: 20px;
}

.sp-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.sp-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.sp-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Widget de objetivo */
.sp-donation-goal {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sp-goal-text {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 15px;
    font-size: 18px;
}

.sp-goal-raised {
    font-size: 28px;
    font-weight: 700;
    color: var(--sp-primary);
}

.sp-goal-separator {
    margin: 0 10px;
    color: var(--sp-gray);
}

.sp-goal-target {
    font-size: 20px;
    font-weight: 600;
    color: var(--sp-secondary);
}

.sp-goal-progress {
    height: 30px;
    background: var(--sp-light);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sp-goal-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--sp-primary), var(--sp-accent));
    border-radius: 15px;
    transition: width 1s ease;
}

.sp-goal-percentage {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--sp-secondary);
}

/* Lista de donaciones recientes */
.sp-recent-donations {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.sp-donations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sp-donation-item {
    padding: 15px;
    border-bottom: 1px solid var(--sp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

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

.sp-donor-name {
    font-weight: 600;
    color: var(--sp-secondary);
}

.sp-donation-amount {
    font-weight: 600;
    color: var(--sp-primary);
}

.sp-donation-date {
    font-size: 13px;
    color: var(--sp-gray);
}

/* Responsive */
@media (max-width: 768px) {
    .sp-form-row {
        flex-direction: column;
        gap: 0;
    }

    .sp-form-field.sp-field-half {
        width: 100%;
    }

    .sp-amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .sp-recurring-options {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sp-form-section {
        padding: 20px 15px;
    }

    .sp-amount-buttons {
        grid-template-columns: 1fr;
    }

    .sp-goal-text {
        flex-direction: column;
        align-items: center;
    }

    .sp-goal-separator {
        margin: 5px 0;
    }
}
