/* Estilos base responsive */
* {
    box-sizing: border-box;
}

body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 20px;
    min-height: 100vh;
}

/* Tablet y móviles */
@media (max-width: 1024px) {
    .container {
        padding: 12px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .grid {
        gap: 12px;
    }
}

.panelEom {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 16px;
}

/* Responsive para paneles */
@media (max-width: 1024px) {
    .panelEom {
        position: static; /* Quitar sticky en tablets/móviles */
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .panelEom {
        padding: 16px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .panelEom {
        padding: 12px;
        border-radius: 6px;
    }
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #FAEFF1;
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.icon {
    width: 20px;
    height: 20px;
}

.progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #7E152B;
    transition: width 0.3s ease;
    border-radius: 3px;
    width: 16.67%;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.step-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
    gap: 6px;
}

.step {
    flex: 0 1 auto;
    min-width: 90px;
    max-width: 140px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: normal;
    overflow: visible;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: keep-all;
    hyphens: none;
}

/* Responsive para steps */
@media (max-width: 768px) {
    .step {
        min-width: 75px;
        max-width: 110px;
        padding: 10px 8px;
        font-size: 12px;
        line-height: 1.3;
        min-height: 45px;
    }
}

@media (max-width: 480px) {
    .step-nav {
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .step {
        min-width: 65px;
        max-width: 90px;
        font-size: 11px;
        padding: 8px 6px;
        line-height: 1.2;
        min-height: 40px;
    }
}

.step.active {
    background-color: #7E152B;
    color: #ffffff;
}

.step.completed {
    background-color: #470b18;
    color: #ffffff;
}

.step.inactive {
    background-color: #FAEFF1;
    color: #a0aec0;
}

.form-page {
    display: none;
    min-height: 300px;
}

.form-page.active {
    display: block;
}

.form-section {
    margin-bottom: 24px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #FAEFF1;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Responsive para formularios */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-section {
        margin-bottom: 16px;
    }
    
    .section-header h3 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 12px;
    }
    
    label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    select {
        padding: 8px 10px;
        font-size: 13px;
    }
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

.required::after {
    content: " *";
    color: #e53e3e;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
    outline: none;
    border-color: #7E152B;
    box-shadow: 0 0 0 3px rgba(126, 21, 43, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-option input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #7E152B;
}

.checkbox-option label {
    font-size: 13px;
    line-height: 1.5;
    color: #4a5568;
    cursor: pointer;
    margin-bottom: 0;
}

.signature-pad-container {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    background-color: #ffffff;
    text-align: center;
    position: relative;
}

/* Responsive para firma */
@media (max-width: 768px) {
    .signature-pad-container {
        padding: 12px;
    }
    
    #signaturePad {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .signature-pad-container {
        padding: 8px;
        margin: 0 -4px; /* Extender un poco más en móviles pequeños */
    }
}

.signature-pad-container.signature-valid {
    border-color: #38a169;
}

.signature-pad-container.signature-empty {
    border-color: #e53e3e;
}

.signature-canvas-wrapper {
    position: relative;
    display: inline-block;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: #fafafa;
}

#signaturePad {
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a0aec0;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.signature-placeholder.hidden {
    display: none;
}

.signature-controls {
    margin-top: 12px;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #FAEFF1;
}

/* Responsive para botones de navegación */
@media (max-width: 768px) {
    .nav-buttons {
        margin-top: 16px;
        padding-top: 12px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .nav-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px; /* Tamaño mínimo táctil */
    touch-action: manipulation; /* Evitar zoom en doble tap */
}

/* Mejorar botones en móviles */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .btn {
        min-height: 52px;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 8px;
    }
}

.btn-primary {
    background-color: #7E152B;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5a0f1f;
}

.btn-secondary {
    background-color: #FAEFF1;
    color: #4a5568;
}

.btn-secondary:hover {
    background-color: #f2d6dc;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background-color: #38a169;
    color: #ffffff;
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success:hover:not(:disabled) {
    background-color: #2f855a;
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-payment {
    background-color: #f59e0b;
    color: #ffffff;
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-payment:hover:not(:disabled) {
    background-color: #d97706;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.contract-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
    font-size: 13px;
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Responsive para vista previa del contrato */
@media (max-width: 1024px) {
    .contract-preview {
        /* Sin restricción de altura */
    }
}

@media (max-width: 768px) {
    .contract-preview {
        padding: 16px;
        font-size: 12px;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .contract-preview {
        padding: 12px;
        font-size: 11px;
        border-radius: 6px;
        max-height: 50vh;
    }
}

.contract-title {
    text-align: center;
    margin-bottom: 24px;
}

.contract-title h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a202c;
}

.version-info {
    font-size: 12px;
    color: #718096;
    text-align: center;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.contract-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: #7E152B;
}

.contract-section {
    margin-bottom: 16px;
}

.contract-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.contract-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 12px;
    color: #4a5568;
}

.contract-section ul {
    margin-left: 20px;
    margin-top: 6px;
}

.contract-section li {
    margin-bottom: 3px;
}

.highlighted {
    color: #7E152B;
    font-weight: 600;
    background-color: #FAEFF1;
    padding: 1px 4px;
    border-radius: 3px;
}

.signature-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #FAEFF1;
}

.signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
    text-align: center;
}

/* Responsive para grid de firmas */
@media (max-width: 768px) {
    .signature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    .signature-grid {
        gap: 12px;
        margin-top: 12px;
    }
}

.signature-line {
    border-top: 1px solid #718096;
    padding-top: 6px;
    margin-top: 32px;
}

.plan-selected {
    background-color: #FAEFF1;
    border: 2px solid #7E152B;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.plan-selected h4 {
    color: #7E152B;
    margin-bottom: 8px;
}

.data-box {
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
}

.error-message {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
}

input.error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.1) !important;
}

input.error:focus {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2) !important;
}

.signature-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.signature-status.valid {
    background-color: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.signature-status.invalid {
    background-color: #fef2f2;
    color: #e53e3e;
    border: 1px solid #fca5a5;
}

/* Estilos para el formulario de configuración */
#eom-contracts-config {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#eom-contracts-config h2 {
    margin-bottom: 20px;
    color: #1a202c;
    text-align: center;
}

#eom-contracts-config .form-group {
    margin-bottom: 16px;
}

#eom-contracts-config label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #4a5568;
}

#eom-contracts-config select,
#eom-contracts-config input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

#config-result {
    margin-top: 20px;
    padding: 16px;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 6px;
}

#config-result h3 {
    color: #7E152B;
    margin-bottom: 10px;
}

#config-result code {
    background: #FAEFF1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}