/**
 * Reclamo.io Form Styles
 * Estilos del formulario y modales
 *
 * @package Reclamo_Form_Connector
 */

/* Variables CSS */
:root {
    --reclamo-black: #0a0a0a;
    --reclamo-black-light: #1a1a1a;
    --reclamo-gold: #d4af37;
    --reclamo-gold-dark: #b8962e;
    --reclamo-gold-light: #f4e4bc;
    --reclamo-white: #ffffff;
    --reclamo-gray: #6b7280;
    --reclamo-gray-light: #9ca3af;
    --reclamo-success: #10b981;
    --reclamo-error: #ef4444;
    --reclamo-border: rgba(212, 175, 55, 0.2);
    --reclamo-border-light: rgba(212, 175, 55, 0.1);
    --reclamo-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --reclamo-radius: 12px;
    --reclamo-radius-sm: 8px;
    --reclamo-transition: all 0.3s ease;
}

/* Reset básico */
.reclamo-form-wrapper *,
.reclamo-form-wrapper *::before,
.reclamo-form-wrapper *::after {
    box-sizing: border-box;
}

/* Contenedor principal */
.reclamo-form-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* Tema oscuro (default) */
.reclamo-theme-dark {
    background: var(--reclamo-black);
    border: 1px solid var(--reclamo-border);
    border-radius: var(--reclamo-radius);
    padding: 32px;
    color: var(--reclamo-white);
}

/* Tema claro */
.reclamo-theme-light {
    background: var(--reclamo-white);
    border: 1px solid #e5e7eb;
    border-radius: var(--reclamo-radius);
    padding: 32px;
    color: var(--reclamo-black);
}

.reclamo-theme-light .reclamo-field label {
    color: var(--reclamo-black);
}

.reclamo-theme-light .reclamo-field input,
.reclamo-theme-light .reclamo-field select,
.reclamo-theme-light .reclamo-field textarea {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: var(--reclamo-black);
}

/* Header del formulario */
.reclamo-form-header {
    text-align: center;
    margin-bottom: 28px;
}

.reclamo-form-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: inherit;
}

.reclamo-form-header p {
    font-size: 14px;
    color: var(--reclamo-gray-light);
    margin: 0;
}

/* Campos del formulario */
.reclamo-field {
    margin-bottom: 20px;
    position: relative;
}

.reclamo-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--reclamo-white);
}

.reclamo-field label .required {
    color: var(--reclamo-gold);
    margin-left: 2px;
}

.reclamo-field input,
.reclamo-field select,
.reclamo-field textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: var(--reclamo-black-light);
    border: 1px solid var(--reclamo-border);
    border-radius: var(--reclamo-radius-sm);
    color: var(--reclamo-white);
    transition: var(--reclamo-transition);
    outline: none;
}

.reclamo-field input::placeholder,
.reclamo-field textarea::placeholder {
    color: var(--reclamo-gray);
}

.reclamo-field input:focus,
.reclamo-field select:focus,
.reclamo-field textarea:focus {
    border-color: var(--reclamo-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.reclamo-field select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

.reclamo-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Descripción del campo */
.reclamo-field-description {
    display: block;
    font-size: 12px;
    color: var(--reclamo-gray);
    margin-top: 6px;
}

/* Contador de caracteres */
.reclamo-char-count {
    display: block;
    font-size: 12px;
    color: var(--reclamo-gray);
    text-align: right;
    margin-top: 4px;
}

/* Errores */
.reclamo-field.has-error input,
.reclamo-field.has-error select,
.reclamo-field.has-error textarea {
    border-color: var(--reclamo-error);
}

.reclamo-field.has-error input:focus,
.reclamo-field.has-error select:focus,
.reclamo-field.has-error textarea:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.reclamo-field-error {
    display: block;
    font-size: 13px;
    color: var(--reclamo-error);
    margin-top: 6px;
    min-height: 20px;
}

/* Honeypot (oculto) */
.reclamo-hp-field {
    position: absolute !important;
    left: -9999px !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Consentimiento */
.reclamo-consent {
    font-size: 12px;
    color: var(--reclamo-gray);
    margin-bottom: 20px;
}

.reclamo-consent p {
    margin: 0;
}

.reclamo-consent a {
    color: var(--reclamo-gold);
    text-decoration: none;
}

.reclamo-consent a:hover {
    text-decoration: underline;
}

/* Botones */
.reclamo-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--reclamo-gold), var(--reclamo-gold-dark));
    color: var(--reclamo-black);
    border: none;
    border-radius: var(--reclamo-radius-sm);
    cursor: pointer;
    transition: var(--reclamo-transition);
}

.reclamo-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.reclamo-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.reclamo-btn-primary.is-loading {
    pointer-events: none;
}

.reclamo-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: var(--reclamo-gray-light);
    border: 1px solid var(--reclamo-border);
    border-radius: var(--reclamo-radius-sm);
    cursor: pointer;
    transition: var(--reclamo-transition);
}

.reclamo-btn-secondary:hover {
    border-color: var(--reclamo-gold);
    color: var(--reclamo-gold);
}

/* Spinner */
.reclamo-spinner {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    animation: reclamo-spin 1s linear infinite;
}

@keyframes reclamo-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Badges de seguridad */
.reclamo-security-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--reclamo-border-light);
}

.reclamo-security-badges .badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--reclamo-gray);
}

.reclamo-security-badges svg {
    opacity: 0.7;
}

/* Modales */
.reclamo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999999;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.reclamo-modal-content {
    background: var(--reclamo-black);
    border: 1px solid var(--reclamo-border);
    border-radius: var(--reclamo-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: reclamo-modal-in 0.3s ease;
}

@keyframes reclamo-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.reclamo-modal-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--reclamo-border-light);
}

.reclamo-success-icon,
.reclamo-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.reclamo-success-icon {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--reclamo-success);
}

.reclamo-success-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--reclamo-success);
}

.reclamo-error-icon {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--reclamo-error);
}

.reclamo-error-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--reclamo-error);
}

.reclamo-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--reclamo-white);
    margin: 0 0 8px;
}

.reclamo-modal-header p {
    font-size: 14px;
    color: var(--reclamo-gray-light);
    margin: 0;
}

.reclamo-modal-body {
    padding: 24px 32px;
}

.reclamo-case-id {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--reclamo-black-light);
    padding: 12px 16px;
    border-radius: var(--reclamo-radius-sm);
    margin-bottom: 24px;
}

.reclamo-case-id .label {
    font-size: 13px;
    color: var(--reclamo-gray);
}

.reclamo-case-id .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--reclamo-gold);
}

.reclamo-documents h4,
.reclamo-next-steps h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--reclamo-white);
    margin: 0 0 12px;
}

.reclamo-doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.reclamo-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--reclamo-black-light);
    border: 1px solid var(--reclamo-border-light);
    border-radius: var(--reclamo-radius-sm);
    color: var(--reclamo-white);
    text-decoration: none;
    transition: var(--reclamo-transition);
}

.reclamo-doc-item:hover {
    border-color: var(--reclamo-gold);
    background: rgba(212, 175, 55, 0.05);
}

.reclamo-doc-item .doc-name {
    font-size: 14px;
}

.reclamo-doc-item .doc-action {
    font-size: 13px;
    color: var(--reclamo-gold);
}

.reclamo-next-steps ol {
    margin: 0;
    padding-left: 20px;
}

.reclamo-next-steps li {
    font-size: 14px;
    color: var(--reclamo-gray-light);
    margin-bottom: 8px;
}

.reclamo-next-steps li:last-child {
    margin-bottom: 0;
}

.reclamo-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--reclamo-border-light);
}

.reclamo-modal-error .reclamo-modal-footer {
    justify-content: space-between;
}

/* Body cuando modal está abierto */
body.reclamo-modal-open {
    overflow: hidden;
}

/* Formulario deshabilitado */
.reclamo-disabled {
    text-align: center;
    padding: 40px 20px;
    color: var(--reclamo-gray);
    background: var(--reclamo-black-light);
    border-radius: var(--reclamo-radius);
    border: 1px solid var(--reclamo-border);
}

/* Error de template */
.reclamo-error {
    text-align: center;
    padding: 20px;
    color: var(--reclamo-error);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--reclamo-radius);
    border: 1px solid var(--reclamo-error);
}

/* Responsive */
@media (max-width: 480px) {
    .reclamo-theme-dark,
    .reclamo-theme-light {
        padding: 24px 20px;
        border-radius: var(--reclamo-radius-sm);
    }

    .reclamo-form-header h3 {
        font-size: 20px;
    }

    .reclamo-security-badges {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .reclamo-modal-content {
        margin: 10px;
    }

    .reclamo-modal-header,
    .reclamo-modal-body,
    .reclamo-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .reclamo-modal-footer {
        flex-direction: column-reverse;
    }

    .reclamo-modal-footer .reclamo-btn-primary,
    .reclamo-modal-footer .reclamo-btn-secondary {
        width: 100%;
    }
}
