/**
 * Estilos Corporativos Oficiales para Autorización Salida Menor (v1.1.0)
 * Segunda Notaría de Vallenar
 * Paleta: Verde oliva (#5B7B4A / #3D5A30 / #2F5E43), Dorado (#C9A96E), Texto (#2C2F2C / #5A5F5A)
 */

.asm-wrap {
    display: block;
    width: 100%;
    max-width: 820px;
    margin: 0.5rem auto 2.5rem auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #2C2F2C !important;
    box-sizing: border-box;
}

.asm-wrap *,
.asm-wrap *::before,
.asm-wrap *::after {
    box-sizing: border-box;
}

/* Card principal Glassmorphism corporativa */
.asm-card {
    position: relative;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(91, 123, 74, 0.22) !important;
    border-radius: 18px !important;
    padding: 2rem 1.8rem !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden;
}

.asm-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 123, 74, 0.04) 0%, transparent 50%, rgba(201, 169, 110, 0.03) 100%);
    pointer-events: none;
    border-radius: inherit;
}

/* Header corporativo */
.asm-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.asm-seal {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.8rem;
    background: linear-gradient(135deg, #5B7B4A, #3D5A30);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(91, 123, 74, 0.28);
}

.asm-seal svg {
    width: 26px;
    height: 26px;
}

.asm-badge-corp {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #5B7B4A;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

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

.asm-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    color: #5A5F5A !important;
    line-height: 1.5 !important;
    margin: 0 auto 0.8rem auto !important;
    max-width: 520px;
}

.asm-divider {
    width: 50px;
    height: 2.5px;
    background: linear-gradient(90deg, transparent, #C9A96E, transparent);
    margin: 0.6rem auto 1.4rem auto;
    border-radius: 2px;
}

/* Indicador de pasos sobrio y elegante */
.asm-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 520px;
    margin: 0 auto 1.2rem auto;
    padding: 8px 14px;
    background: #F7F9F6;
    border: 1px solid #E2E7DF;
    border-radius: 30px;
}

.asm-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #7A7F7A;
    transition: all 0.2s ease;
}

.asm-step-item .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E2E7DF;
    color: #5A5F5A;
    font-size: 11px;
    font-weight: 700;
}

.asm-step-item.active {
    color: #2C2F2C !important;
}

.asm-step-item.active .step-num {
    background: linear-gradient(135deg, #5B7B4A, #3D5A30) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 6px rgba(61, 90, 48, 0.3);
}

.asm-step-line {
    flex: 1;
    max-width: 25px;
    height: 1.5px;
    background: #D4D8D0;
}

@media (max-width: 600px) {
    .asm-step-item .step-text {
        display: none;
    }
    .asm-step-line {
        max-width: 16px;
    }
}

/* Paneles de pasos */
.asm-step-panel {
    display: none;
}

.asm-step-panel.active {
    display: block;
    animation: asmFadeIn 0.3s ease;
}

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

/* Secciones y cajas */
.asm-section-box {
    background: #F9FAF8 !important;
    border: 1px solid #E8EBE4 !important;
    border-radius: 14px !important;
    padding: 20px 18px !important;
    margin-bottom: 20px !important;
}

.asm-section-title {
    font-family: Georgia, 'Times New Roman', serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #2C2F2C !important;
    margin: 0 0 10px 0 !important;
    border-bottom: 1px solid #E8EBE4;
    padding-bottom: 8px;
}

.asm-hint {
    font-size: 0.88rem !important;
    color: #5A5F5A !important;
    line-height: 1.55 !important;
    margin-bottom: 16px !important;
}

.asm-subhead {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #3D5A30 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    margin: 16px 0 10px 0 !important;
}

/* Grillas */
.asm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.asm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.span-2 {
    grid-column: span 2;
}

@media (max-width: 650px) {
    .asm-grid-2, .asm-grid-3 {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
}

/* Campos de entrada */
.asm-field {
    margin-bottom: 10px;
}

.asm-field label {
    display: block !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    color: #3D5A30 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    margin-bottom: 0.4rem !important;
}

.asm-field input[type="text"],
.asm-field input[type="tel"],
.asm-field input[type="date"],
.asm-field select {
    width: 100% !important;
    padding: 0.82rem 1rem !important;
    background: #FFFFFF !important;
    border: 1.5px solid #D4D8D0 !important;
    border-radius: 10px !important;
    color: #2C2F2C !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0.92rem !important;
    font-weight: 400 !important;
    outline: none !important;
    transition: border 0.25s, box-shadow 0.25s !important;
}

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

/* Radio Cards */
.asm-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.asm-radio-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1.5px solid #D4D8D0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4A4F4A;
    transition: all 0.2s ease;
}

.asm-radio-card:hover {
    border-color: #5B7B4A;
    background: #F7F9F6;
}

.asm-radio-card input[type="radio"]:checked + span {
    color: #3D5A30;
    font-weight: 700;
}

/* Zona de subida (Dropzone) en Verde Corporativo Notaría */
.asm-upload-zone {
    border: 2px dashed #7A9E66 !important;
    background: #F7F9F6 !important;
    border-radius: 14px !important;
    padding: 28px 20px !important;
    text-align: center !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.25s ease !important;
}

.asm-upload-zone:hover {
    background: #EFF3EC !important;
    border-color: #5B7B4A !important;
}

.asm-upload-zone input[type="file"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

.asm-upload-icon {
    margin-bottom: 8px;
}

.asm-upload-text {
    font-weight: 700 !important;
    color: #3D5A30 !important;
    font-size: 0.95rem !important;
    margin-bottom: 4px !important;
}

.asm-upload-subtext {
    font-size: 0.8rem !important;
    color: #7A7F7A !important;
}

.asm-file-selected {
    margin-top: 12px;
    padding: 7px 14px;
    background: #E8F0E4;
    color: #2F5E43;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.asm-scan-notice {
    margin-top: 14px;
    padding: 12px 16px;
    background: #FDF9F0;
    border: 1px solid #F3E4C0;
    color: #8C6820;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tarjeta interactiva de previsualización y corrección */
.asm-parsed-preview {
    margin-top: 18px;
    padding: 18px 20px;
    background: #F7F9F6;
    border: 1.5px solid #C4D9BC;
    border-radius: 12px;
}

.asm-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2F5E43;
    margin-bottom: 4px;
}

.asm-preview-hint {
    font-size: 0.82rem;
    color: #5A5F5A;
    margin: 0 0 14px 0;
}

.asm-parsed-preview .asm-field label {
    font-size: 0.72rem !important;
    margin-bottom: 2px !important;
}

.asm-parsed-preview .asm-field input {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.88rem !important;
    background: #FFFFFF !important;
}

.asm-scan-success {
    margin-top: 14px;
    padding: 12px 16px;
    background: #E8F0E4;
    border: 1px solid #C4D9BC;
    color: #2F5E43;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.asm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #8C6820;
    border-top-color: transparent;
    border-radius: 50%;
    animation: asmSpin 0.7s linear infinite;
}

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

/* Botones oficiales en Verde Notarial */
.asm-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    gap: 12px;
}

.asm-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.82rem 1.8rem !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.asm-btn-primary {
    background: linear-gradient(135deg, #5B7B4A 0%, #3D5A30 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(91, 123, 74, 0.3) !important;
    margin-left: auto;
}

.asm-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(91, 123, 74, 0.38) !important;
    background: linear-gradient(135deg, #6B8B5A 0%, #4D6A40 100%) !important;
}

.asm-btn-secondary {
    background: #F0F2EE !important;
    border: 1px solid #D4D8D0 !important;
    color: #3D5A30 !important;
}

.asm-btn-secondary:hover {
    background: #E5E9E2 !important;
}

.asm-btn-success {
    background: linear-gradient(135deg, #5B7B4A 0%, #2F5E43 100%) !important;
    color: #FFFFFF !important;
    width: 100% !important;
    box-shadow: 0 4px 16px rgba(47, 94, 67, 0.35) !important;
}

.asm-btn-success:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 22px rgba(47, 94, 67, 0.42) !important;
}

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

/* Pantalla final de éxito */
.asm-card-success {
    text-align: center;
    padding: 30px 20px;
}

.asm-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, #5B7B4A, #3D5A30);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(91, 123, 74, 0.3);
    font-size: 32px;
}

.asm-ticket-box {
    background: #F7F9F6;
    border: 2px dashed #7A9E66;
    border-radius: 12px;
    padding: 22px;
    margin: 22px 0;
}

.asm-ticket-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #5B7B4A;
    text-transform: uppercase;
}

.asm-ticket-code {
    font-size: 28px;
    font-weight: 800;
    color: #2F5E43;
    letter-spacing: 2px;
    margin: 8px 0;
}

.asm-ticket-sub {
    font-size: 0.85rem;
    color: #5A5F5A;
}

.asm-instructions-box {
    text-align: left;
    background: #FFFFFF;
    border: 1px solid #E8EBE4;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.asm-instructions-box h4 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    color: #2C2F2C;
    margin: 0 0 10px 0;
}

.asm-instructions-box ol {
    margin: 0;
    padding-left: 20px;
}

.asm-notice-warning {
    background: #FDF9F0;
    border-left: 4px solid #C9A96E;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.84rem;
    color: #8C6820;
    border-radius: 0 8px 8px 0;
    margin-top: 18px;
}

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

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

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

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

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

.asm-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;
}

.asm-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;
}

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

.asm-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;
}

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

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

/* Banner de Asistencia para Obtención de Certificado en Registro Civil */
.asm-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;
}

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

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

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

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

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

.asm-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;
}

.asm-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;
}

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

/* Distintivos y Alertas de Cotejo de Menor de Edad */
.asm-age-badge {
    margin: 12px 0 16px 0;
}

.asm-badge-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.asm-badge-success {
    background: #EFF8EE !important;
    border: 1.5px solid #A8D5A3 !important;
    color: #1E4620 !important;
}

.asm-badge-success .asm-badge-icon {
    font-size: 1.25rem;
    color: #2F5E43;
    font-weight: 700;
}

.asm-badge-danger {
    background: #FDF2F2 !important;
    border: 1.5px solid #F5A5A5 !important;
    color: #8C1D1D !important;
}

.asm-badge-danger .asm-badge-icon {
    font-size: 1.25rem;
    color: #D32F2F;
    font-weight: 700;
}

.asm-badge-content strong {
    display: block;
    margin-bottom: 2px;
}

/* Tag de resumen en Paso 3 */
.asm-child-verified-tag {
    background: #F2F7F0;
    border-left: 4px solid #5B7B4A;
    padding: 9px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 0.86rem;
    color: #2C2F2C;
    margin-bottom: 14px;
}

.asm-child-verified-tag .asm-tag-icon {
    color: #2F5E43;
    font-weight: 700;
    margin-right: 4px;
}

/* Tarjetas de radio interactivas activas */
.asm-radio-card.active {
    border-color: #5B7B4A !important;
    background: #F4F7F2 !important;
    box-shadow: 0 0 0 2px rgba(91, 123, 74, 0.25) !important;
}

