/**
 * Estilos Corporativos Oficiales para Poder Especial de Venta de Vehículos (v1.0.0)
 * Segunda Notaría de Vallenar - Notario Interino Patricio Urquieta García
 * Paleta: Verde oliva (#5B7B4A / #3D5A30 / #2F5E43), Dorado (#C9A96E), Neutros (#2C2F2C / #F7F9F6)
 */

.pvv-container {
    display: block;
    width: 100%;
    max-width: 820px;
    margin: 1rem auto 3rem auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: #2C2F2C !important;
    box-sizing: border-box;
}

.pvv-container *,
.pvv-container *::before,
.pvv-container *::after {
    box-sizing: border-box;
}

/* Card principal Glassmorphism corporativo */
.pvv-card {
    position: relative;
    background: #FFFFFF !important;
    border: 1px solid rgba(91, 123, 74, 0.22) !important;
    border-radius: 18px !important;
    padding: 2.2rem 2rem !important;
    box-shadow: 0 10px 32px rgba(44, 47, 44, 0.08) !important;
    overflow: hidden;
}

.pvv-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3D5A30 0%, #5B7B4A 50%, #C9A96E 100%);
}

/* Encabezado */
.pvv-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pvv-header-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: #5B7B4A;
    text-transform: uppercase;
    background: rgba(91, 123, 74, 0.08);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(91, 123, 74, 0.2);
}

.pvv-title {
    font-family: Georgia, 'Times New Roman', serif !important;
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    color: #2C2F2C !important;
    line-height: 1.3 !important;
    margin: 0 0 0.4rem 0 !important;
}

.pvv-subtitle {
    font-size: 0.92rem !important;
    color: #5A5F5A !important;
    line-height: 1.5 !important;
    margin: 0 auto !important;
    max-width: 580px;
}

/* Barra de progreso de pasos */
.pvv-steps-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 2.2rem;
    padding: 0 10px;
}

.pvv-steps-bar::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #E5E9E2;
    z-index: 1;
}

.pvv-step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    background: transparent;
}

.pvv-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2.5px solid #D4D8D0;
    color: #7A807A;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.pvv-step-lbl {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7A807A;
    transition: color 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pvv-step-item.active .pvv-step-num {
    background: #3D5A30;
    border-color: #3D5A30;
    color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(61, 90, 48, 0.18);
}

.pvv-step-item.active .pvv-step-lbl {
    color: #3D5A30;
    font-weight: 700;
}

.pvv-step-item.completed .pvv-step-num {
    background: #5B7B4A;
    border-color: #5B7B4A;
    color: #FFFFFF;
}

.pvv-step-item.completed .pvv-step-lbl {
    color: #5B7B4A;
}

/* Paneles de pasos */
.pvv-step-panel {
    display: none;
    animation: pvvFadeIn 0.3s ease;
}

.pvv-step-panel.active {
    display: block;
}

@keyframes pvvFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bloques de sección */
.pvv-section-box {
    background: #FAFCF9;
    border: 1px solid #E5E9E2;
    border-radius: 12px;
    padding: 1.5rem 1.4rem;
    margin-bottom: 1.5rem;
}

.pvv-section-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2F5E43;
    margin: 0 0 0.4rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid rgba(91, 123, 74, 0.18);
}

.pvv-hint {
    font-size: 0.86rem;
    color: #606660;
    margin: 0 0 1.2rem 0;
    line-height: 1.45;
}

/* Zona de subida CAV PDF */
.pvv-upload-zone {
    position: relative;
    border: 2px dashed #93A884;
    border-radius: 12px;
    background: #FFFFFF;
    padding: 1.8rem 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 1rem;
}

.pvv-upload-zone:hover,
.pvv-upload-zone.dragover {
    border-color: #3D5A30;
    background: rgba(91, 123, 74, 0.05);
}

.pvv-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.pvv-upload-icon {
    margin-bottom: 0.5rem;
}

.pvv-upload-text {
    font-size: 1rem;
    font-weight: 700;
    color: #2F5E43;
    margin-bottom: 0.2rem;
}

.pvv-upload-subtext {
    font-size: 0.82rem;
    color: #7A807A;
}

.pvv-file-selected {
    margin-top: 0.8rem;
    display: inline-block;
    padding: 6px 14px;
    background: #EAF4E8;
    color: #2F5E43;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    border: 1px solid #A8D1A0;
}

/* Estado de escaneo */
.pvv-scan-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #FEF8ED;
    border: 1px solid #F0D49C;
    border-radius: 10px;
    color: #8C5E14;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.pvv-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(140, 94, 20, 0.25);
    border-top-color: #8C5E14;
    border-radius: 50%;
    animation: pvvSpin 0.7s linear infinite;
}

@keyframes pvvSpin {
    to { transform: rotate(360deg); }
}

/* Tarjeta de datos extraídos */
.pvv-extracted-card {
    background: #F0F8EE;
    border: 1.5px solid #A5D69E;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.pvv-extracted-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #25661D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.pvv-extracted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
    font-size: 0.88rem;
    color: #2C2F2C;
}

/* Campos de Formulario y Rejillas */
.pvv-field {
    margin-bottom: 1rem;
}

.pvv-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 1rem;
}

.pvv-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}

.pvv-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #383B38;
    margin-bottom: 0.35rem;
}

.pvv-input {
    width: 100% !important;
    height: 44px !important;
    padding: 8px 12px !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    color: #2C2F2C !important;
    background: #FFFFFF !important;
    border: 1.5px solid #D4D8D0 !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    box-shadow: none !important;
}

select.pvv-input {
    appearance: auto !important;
    cursor: pointer;
}

.pvv-input:focus {
    border-color: #5B7B4A !important;
    box-shadow: 0 0 0 3px rgba(91, 123, 74, 0.18) !important;
}

.pvv-input.pvv-error {
    border-color: #D32F2F !important;
    background: #FFF9F9 !important;
}

/* Caja de cláusula notarial */
.pvv-clause-box {
    background: #FFFFFF;
    border-left: 4px solid #C9A96E;
    border-top: 1px solid #E5E9E2;
    border-right: 1px solid #E5E9E2;
    border-bottom: 1px solid #E5E9E2;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 1rem 0;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.5;
}

.pvv-clause-box strong {
    color: #2F5E43;
    display: block;
    margin-bottom: 4px;
}

.pvv-clause-box em {
    font-style: normal;
    font-weight: 700;
    text-decoration: underline;
    color: #1A1A1A;
}

/* Tarjeta resumen */
.pvv-summary-card {
    background: #FFFFFF;
    border: 1.5px solid #D4D8D0;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 0.92rem;
}

.pvv-summary-card div strong {
    color: #5B7B4A;
    display: inline-block;
    min-width: 100px;
}

/* Caja de Captcha Matemático Anti-spam */
.pvv-captcha-box {
    background: #F8FAF7 !important;
    border: 1.5px solid #D4D8D0 !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    margin: 1.4rem 0 0.5rem 0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03) !important;
}

.pvv-captcha-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #2F5E43;
}

.pvv-captcha-icon {
    font-size: 1.1rem;
}

.pvv-captcha-hint {
    font-size: 0.82rem;
    color: #6C726A;
    font-weight: normal;
}

.pvv-captcha-body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pvv-captcha-question {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2C2F2C;
    background: #FFFFFF;
    border: 1.5px solid #C1C9BE;
    padding: 8px 16px;
    border-radius: 8px;
    letter-spacing: 1px;
}

.pvv-captcha-input {
    width: 120px !important;
    height: 42px !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    border: 1.5px solid #C1C9BE !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    outline: none !important;
    background: #FFFFFF !important;
}

.pvv-captcha-input:focus {
    border-color: #5B7B4A !important;
    box-shadow: 0 0 0 3px rgba(91, 123, 74, 0.18) !important;
}

.pvv-captcha-refresh {
    background: #FFFFFF;
    border: 1.5px solid #D4D8D0;
    color: #5B7B4A;
    font-size: 1.25rem;
    font-weight: 700;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pvv-captcha-refresh:hover {
    background: #EAF2E8;
    border-color: #5B7B4A;
    transform: rotate(45deg);
}

.pvv-captcha-error {
    color: #D32F2F;
    font-size: 0.86rem;
    font-weight: 600;
    margin-top: 8px;
}

/* Botones de navegación */
.pvv-nav-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 12px;
}

.pvv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.pvv-btn-primary {
    background: linear-gradient(135deg, #3D5A30, #5B7B4A) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(61, 90, 48, 0.25) !important;
}

.pvv-btn-primary:hover {
    background: linear-gradient(135deg, #2F4725, #4A653C) !important;
    box-shadow: 0 6px 18px rgba(61, 90, 48, 0.35) !important;
    transform: translateY(-1px);
}

.pvv-btn-secondary {
    background: #FFFFFF !important;
    border: 1.5px solid #D4D8D0 !important;
    color: #4A4F4A !important;
}

.pvv-btn-secondary:hover {
    background: #F2F4F0 !important;
    border-color: #B8BFB2 !important;
    color: #1A1A1A !important;
}

.pvv-btn-submit {
    background: linear-gradient(135deg, #2F5E43, #1E3D2B) !important;
    font-size: 1.05rem !important;
    padding: 14px 28px !important;
}

.pvv-btn-submit:hover {
    background: linear-gradient(135deg, #234733, #152A1E) !important;
}

.pvv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Pantalla de Éxito */
.pvv-success-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    animation: pvvFadeIn 0.4s ease;
}

.pvv-success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.2rem auto;
    background: linear-gradient(135deg, #3D5A30, #5B7B4A);
    color: #FFFFFF;
    font-size: 38px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(61, 90, 48, 0.3);
}

.pvv-success-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2C2F2C;
    margin: 0 0 0.5rem 0;
}

.pvv-success-sub {
    font-size: 1rem;
    color: #5A5F5A;
    margin: 0 0 1.8rem 0;
}

.pvv-code-display {
    display: inline-block;
    background: #FAFCF9;
    border: 2px dashed #5B7B4A;
    border-radius: 14px;
    padding: 1.2rem 2.2rem;
    margin-bottom: 2rem;
}

.pvv-code-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #5B7B4A;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.4rem;
}

.pvv-code-val {
    font-family: "Courier New", Courier, monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: #2F5E43;
    letter-spacing: 2px;
}

.pvv-success-instructions {
    max-width: 540px;
    margin: 0 auto;
    text-align: left;
    background: #FFFFFF;
    border: 1px solid #E5E9E2;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
}

.pvv-success-instructions h4 {
    margin: 0 0 0.8rem 0;
    color: #2F5E43;
    font-size: 1rem;
}

.pvv-success-instructions ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.92rem;
    color: #444;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 640px) {
    .pvv-card {
        padding: 1.5rem 1rem !important;
        border-radius: 14px !important;
    }

    .pvv-title {
        font-size: 1.3rem !important;
    }

    .pvv-grid-2,
    .pvv-grid-3 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pvv-step-lbl {
        font-size: 0.72rem;
    }

    .pvv-step-num {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .pvv-steps-bar::before {
        top: 15px;
        left: 20px;
        right: 20px;
    }

    .pvv-nav-btns {
        flex-direction: column-reverse;
    }

    .pvv-nav-btns .pvv-btn {
        width: 100%;
    }

    .pvv-code-val {
        font-size: 1.7rem;
    }
}

/* Banner de Asistencia para Obtención de Certificado CAV en Registro Civil */
.pvv-rcivil-helper {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #F4F7F2 !important;
    border: 1.5px solid #C5D5BE !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    margin-bottom: 1.3rem !important;
    box-shadow: 0 2px 8px rgba(47, 94, 67, 0.05) !important;
}

.pvv-rcivil-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: #E4ECE0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvv-rcivil-content {
    flex: 1;
}

.pvv-rcivil-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #2F5E43;
    margin-bottom: 4px;
}

.pvv-rcivil-desc {
    font-size: 0.86rem;
    color: #4A524A;
    line-height: 1.45;
    margin: 0 0 8px 0;
}

.pvv-rcivil-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pvv-rcivil-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2F5E43, #3D5A30) !important;
    color: #FFFFFF !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    padding: 7px 14px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(47, 94, 67, 0.25) !important;
    transition: all 0.2s ease !important;
}

.pvv-rcivil-btn-link:hover {
    background: linear-gradient(135deg, #234732, #2F5E43) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(47, 94, 67, 0.35) !important;
}

.pvv-rcivil-sub {
    font-size: 0.8rem;
    color: #6C726A;
    font-style: italic;
}

