/* ============================================
   FRONTEND FORM - CharlieMax Reviews
   Estilos del formulario de envío público
   ============================================ */
   
   

/* Namespace específico para evitar conflictos */
body .reviews-section,
.cmr-reviews-wrapper .reviews-section {
    --cmr-bg: #fff;
    --cmr-primary: #012956;
    --cmr-accent: #045CB4;
    --cmr-card-radius: 25px;
    --cmr-card-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    --cmr-container-w: 850px;
    --cmr-y-gap: 40vh;
    
    /* IMPORTANTE: Reset de estilos del theme */
    all: revert;
    background: var(--cmr-bg);
    position: relative;
    min-height: 120vh;
    padding: 0;
    margin: 0;
    isolation: isolate;
    
}

/* === Contenedor principal === */
.testimonios-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: var(--cmr-bg);
}

@media (min-width: 641px) {
    .testimonios-form {
        padding: 4rem 1rem;
    }
}

/* === Header === */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.8rem;
    color: var(--cmr-primary);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

@media (min-width: 641px) {
    .form-header h2 {
        font-size: 2.5rem;
    }
}

.form-header p {
    color: var(--cmr-muted);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0;
}

/* === Card === */
.form-card {
    background: #fff;
    border-radius: var(--cmr-radius);
    padding: 1.5rem;
    box-shadow: var(--cmr-shadow);
    border: 1px solid #e6eef8;
}

@media (min-width: 641px) {
    .form-card {
        padding: 2.5rem;
    }
}

/* === Form groups === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--cmr-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group label .required {
    color: var(--cmr-error);
    margin-left: 0.15rem;
}

/* === Inputs === */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.2rem 1rem;           /* +padding para evitar corte superior */
    border: 2px solid #e6eef8;
    border-radius: 12px;
    font-size: .75rem;
    line-height: 1.5;               /* altura de línea suficiente */
    font-family: inherit;
    box-sizing: border-box;         /* evita cálculos raros de alto */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background: #fff;
    color: var(--cmr-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--cmr-accent);
    box-shadow: 0 0 0 3px rgba(4, 107, 210, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* === Rating estrellas === */
.rating-group {
    display: flex;
    gap: 0.5rem;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.rating-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.rating-group label {
    font-size: 2rem;
    color: #e6eef8;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    margin: 0;
}

.rating-group label:hover,
.rating-group label:hover ~ label,
.rating-group input[type="radio"]:checked ~ label {
    color: #fbbf24;
    transform: scale(1.1);
}

.rating-group input[type="radio"]:checked ~ label {
    animation: starPulse 0.3s ease;
}

@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* === Honeypot (anti-spam) === */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    tabindex: -1;
}

/* === Submit button === */
.form-submit {
    margin-top: 2rem;
}

.btn-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--cmr-accent);
    color: #fff;
    border: 2px dashed #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover:not(:disabled) {
    background: #034a94;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 107, 210, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === Spinner === */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Mensajes de estado === */
.form-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 600;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
    display: block;
}

.form-message.error {
    background: #fee;
    color: #991b1b;
    border: 2px solid #dc2626;
    display: block;
}

/* === Character counter === */
.char-counter {
    font-size: 0.85rem;
    color: var(--cmr-muted);
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.error {
    color: var(--cmr-error);
}

/* === Helper text === */
.form-group small {
    display: block;
    color: var(--cmr-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* === Responsive === */
@media (max-width: 640px) {
    .form-card {
        padding: 1.25rem;
    }
    
    .rating-group label {
        font-size: 1.75rem;
    }
    
    .btn-submit {
        font-size: 1rem;
        padding: 0.9rem 1.5rem;
    }
}

/* === Accesibilidad === */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.btn-submit:focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

/* === Error states === */
.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
    border-color: var(--cmr-error);
}

.form-group.has-error label {
    color: var(--cmr-error);
}

.error-message {
    color: var(--cmr-error);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.has-error .error-message {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}


/* ============================================
   REPOSICIONAR reCAPTCHA BADGE
   ============================================ */

/* Agregar al final de frontend-form.css */
.grecaptcha-badge {
    position: static !important;
    display: block !important;
    margin: 1.5rem auto 0 auto !important;
    width: fit-content !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    border-radius: 4px !important;
}

@media (max-width: 768px) {
    .grecaptcha-badge {
        margin-top: 1rem !important;
    }
}