/**
 * Estilos Frontend - Ley 21.719 Protección de Datos Chile
 */

:root {
    --ley-primary: #0052cc;
    --ley-primary-hover: #0747a6;
    --ley-text-dark: #1e293b;
    --ley-text-muted: #64748b;
    --ley-bg-light: #ffffff;
    --ley-bg-dark: #0f172a;
    --ley-border: #e2e8f0;
    --ley-radius: 10px;
    --ley-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Banner Principal de Consentimiento */
.ley21719-banner-wrap {
    position: fixed;
    z-index: 9999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ley21719-banner-wrap * {
    box-sizing: border-box;
}

.ley21719-banner-wrap.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Posiciones */
.ley21719-pos-bottom_bar {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

.ley21719-pos-bottom_left {
    left: 20px;
    bottom: 20px;
    max-width: 480px;
    border-radius: var(--ley-radius);
}

.ley21719-pos-bottom_right {
    right: 20px;
    bottom: 20px;
    max-width: 480px;
    border-radius: var(--ley-radius);
}

.ley21719-pos-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    max-width: 540px;
    width: 90%;
    border-radius: 12px;
}

/* Temas Visuales */
.ley21719-theme-dark_modern {
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.ley21719-theme-light_clean {
    background: #ffffff;
    color: #1e293b;
    border-top: 1px solid var(--ley-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.ley21719-theme-high_contrast {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.ley21719-banner-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .ley21719-pos-bottom_bar .ley21719-banner-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-width: 1200px;
        margin: 0 auto;
    }
}

.ley21719-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.ley21719-banner-text {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
}

.ley21719-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ley21719-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--ley-transition);
    text-decoration: none;
    line-height: 1.2;
}

.ley21719-btn-primary {
    background: var(--ley-primary);
    color: #ffffff !important;
}

.ley21719-btn-primary:hover {
    background: var(--ley-primary-hover);
}

.ley21719-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ley21719-theme-light_clean .ley21719-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.ley21719-btn-link {
    background: transparent;
    color: inherit;
    opacity: 0.85;
    text-decoration: underline;
    padding: 8px 12px;
}

/* 2. Modal Centro de Preferencias */
.ley21719-pref-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ley21719-pref-overlay.active {
    display: flex;
}

.ley21719-pref-modal {
    background: #ffffff;
    color: var(--ley-text-dark);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.ley21719-pref-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--ley-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ley21719-pref-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--ley-text-dark);
}

.ley21719-pref-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ley-text-muted);
}

.ley21719-pref-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.ley21719-cat-item {
    border: 1px solid var(--ley-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    background: #f8fafc;
}

.ley21719-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ley21719-cat-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--ley-text-dark);
}

.ley21719-cat-desc {
    font-size: 13px;
    color: var(--ley-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Switch Toggle Accesible */
.ley21719-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.ley21719-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ley21719-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.ley21719-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.ley21719-switch input:checked + .ley21719-slider {
    background-color: var(--ley-primary);
}

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

.ley21719-switch input:disabled + .ley21719-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.ley21719-pref-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ley-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

/* 3. Botón Flotante Permanente */
.ley21719-floating-trigger {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999998;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--ley-transition);
}

.ley21719-floating-trigger:hover {
    background: var(--ley-primary);
    transform: scale(1.05);
}

/* 4. Formulario Público ARCO-POL Shortcode */
.ley21719-arco-box {
    background: #ffffff;
    border: 1px solid var(--ley-border);
    border-radius: 12px;
    padding: 28px;
    max-width: 680px;
    margin: 24px auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.ley21719-arco-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 20px;
    color: var(--ley-text-dark);
}

.ley21719-arco-desc {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ley-text-muted);
}

.ley21719-form-group {
    margin-bottom: 16px;
}

.ley21719-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 6px;
    color: var(--ley-text-dark);
}

.ley21719-form-group input,
.ley21719-form-group select,
.ley21719-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ley-border);
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
}

.ley21719-form-group input:focus,
.ley21719-form-group select:focus,
.ley21719-form-group textarea:focus {
    outline: none;
    border-color: var(--ley-primary);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.15);
}

.ley21719-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.ley21719-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.ley21719-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
