/* Smaller font for specific date labels */
#fecha_nacimiento_contratante_label,
#fecha_nacimiento_afiliado_label {
    font-size: 11px !important;
    font-weight: 500;
    letter-spacing: 0.2px;
}
/* Auth Button Container */
.auth-button-container {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 2000;
}

.auth-button {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
    text-transform: uppercase;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.35);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button.dashboard {
    background: linear-gradient(135deg, #43e97b 0%, #00bfae 100%);
    box-shadow: 0 8px 20px rgba(67, 233, 123, 0.25);
}

.auth-button.dashboard:hover {
    box-shadow: 0 12px 28px rgba(67, 233, 123, 0.35);
}

/* Logo container styles */
.logo-container {
    position: fixed;
    top: 32px;
    left: 32px;
    z-index: 2000;
    background: none;
}

.logo-img {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
    /* Optionally, add a slight white outline for contrast */
    background: none;
}
input:invalid,
select:invalid {
    border-color: #f56565;
    background-color: #fff5f5;
}

.input-error-message {
    color: #f56565;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 0;
    font-weight: 500;
    min-height: 16px;
}
/* Modern scrollbar for afiliados resumen */
.resumen-afiliados-container::-webkit-scrollbar {
    width: 10px;
    background: #f7fafc;
    border-radius: 8px;
}
.resumen-afiliados-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    min-height: 40px;
}
.resumen-afiliados-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}
.resumen-afiliados-container {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f7fafc;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Responsive disclaimer styles */
.disclaimer-container {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    padding: 3px 10px;
    z-index: 1200;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}
.disclaimer-logo {
    height: 15px;
    width: auto;
    margin-right: 8px;
    margin-left: 5px;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.1));
}
.disclaimer-text {
    font-size: clamp(11px, 2vw, 13px);
    color: #2d3748;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .disclaimer-container {
        flex-direction: column;
        padding: 8px 4px;
    }
    .disclaimer-logo {
        margin-left: 0px;
        margin-right: 0;
        margin-bottom: 4px;
    }
    .disclaimer-text {
        font-size: 11px;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #00bfae 0%, #43e97b 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00bfae 0%, #43e97b 100%);
    z-index: -1;
}

.container {
    max-width: 600px;
    width: 100%;
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
    /* Increase right margin to prevent overlap with both fixed containers */
    margin-right: 700px;
}

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

.header-section {
    margin-bottom: 40px;
    text-align: center;
}

h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 15px;
    color: #718096;
    font-weight: 400;
    line-height: 1.6;
}

.form-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 600;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type='text'],
input[type='email'],
input[type='number'],
input[type='integer'],
input[type='date'],
select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background-color: #f7fafc;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='number']:focus,
input[type='integer']:focus,
input[type='date']:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type='text']::placeholder,
input[type='email']::placeholder,
input[type='number']::placeholder,
input[type='integer']::placeholder {
    color: #a0aec0;
}

input[readonly] {
    background-color: #edf2f7;
    cursor: not-allowed;
    color: #718096;
}

.toggler-group {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #f7fafc;
    padding: 8px 0 8px 0;
    grid-column: 1 / -1;
}

/* Modern switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.slider:before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.1);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, #43e97b 0%, #00bfae 100%);
}

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

.switch-label-text {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-left: 8px;
    letter-spacing: 0.2px;
    user-select: none;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

button {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Restart button: third in .button-group */
.button-group button:nth-child(3) {
    background: #f7fafc;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    min-width: 170px;
    position: relative;
    padding-left: 36px;
}
.button-group button:nth-child(3)::before {
    content: '\2190'; /* Unicode left arrow */
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #667eea;
    font-weight: bold;
}
.button-group button:nth-child(3):hover {
    background: #e2e8f0;
    color: #1a202c;
    border-color: #667eea;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

button[type='submit'] {
    flex: 1;
    min-width: 150px;
}

button:first-of-type {
    background-color: #e2e8f0;
    color: #2d3748;
}

button:first-of-type:hover {
    background-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Primary action (Cotizar Ahora) button style */
.primary-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.result-ok {
    background-color: #c6f6d5;
    border-left: 4px solid #48bb78;
    color: #22543d;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.result-err {
    background-color: #fed7d7;
    border-left: 4px solid #f56565;
    color: #742a2a;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #f7fafc;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.summary-item {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

#status {
    color: #667eea;
    font-weight: 600;
}

.price-container {
    display: none;
    z-index: 1000;
    border-left: 5px solid #667eea;
    position: fixed;
    /* left is now set dynamically by JS */
    top: 300px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(240, 255, 255, 0.95) 100%
    );
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 32px 24px;
    box-shadow:
        0 16px 40px 0 rgba(0, 0, 0, 0.18),
        0 1.5px 8px 0 rgba(102, 126, 234, 0.08);
    min-width: 240px;
    display: none;
    animation: slideInUp 0.4s ease-out;
    z-index: 1000;
    border-left: 6px solid #667eea;
    border-top: 1.5px solid #e2e8f0;
    transition:
        box-shadow 0.3s,
        border-color 0.3s;
}

.price-container.active {
    display: block;
    box-shadow:
        0 24px 48px 0 rgba(102, 126, 234, 0.18),
        0 2px 12px 0 rgba(67, 233, 123, 0.12);
    border-left: 6px solid #43e97b;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.price-display {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.6;
}

.price-display::before {
    content: '💰';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

/* Move resumen-container to the right, just left of price-container, with a minimum gap */
.resumen-container {
    display: none;
    z-index: 1000;
    border-left: 5px solid #48bb78;
    position: fixed;
    /* left is now set dynamically by JS */
    top: 40px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(240, 255, 255, 0.95) 100%
    );
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 32px 24px;
    box-shadow:
        0 16px 40px 0 rgba(0, 0, 0, 0.18),
        0 1.5px 8px 0 rgba(72, 187, 120, 0.08);
    min-width: 240px;
    display: none;
    animation: slideInLeft 0.4s ease-out;
    z-index: 1000;
    border-left: 6px solid #48bb78;
    border-top: 1.5px solid #e2e8f0;
    transition:
        box-shadow 0.3s,
        border-color 0.3s;
}

.resumen-container.active {
    display: block;
    box-shadow:
        0 24px 48px 0 rgba(72, 187, 120, 0.18),
        0 2px 12px 0 rgba(67, 233, 123, 0.12);
    border-left: 6px solid #43e97b;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.resumen-contratante-display {
    text-align: left;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    color: #2d3748;
    line-height: 1.8;
    white-space: pre-line;
}

.resumen-contratante-display::before {
    content: '✓ Contratante';
    display: block;
    font-size: 32px;
    color: #48bb78;
    margin-bottom: 12px;
}

/* Move resumen-afiliados-container to the right, just left of price-container, with a minimum gap */
/* Move resumen-afiliados-container to the right, just left of price-container, with a minimum gap */
.resumen-afiliados-container {
    display: none;
    z-index: 999;
    border-left: 5px solid #4299e1;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: fixed;
    /* left is now set dynamically by JS */
    top: 40px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(240, 255, 255, 0.95) 100%
    );
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 28px 20px;
    box-shadow:
        0 16px 40px 0 rgba(0, 0, 0, 0.18),
        0 1.5px 8px 0 rgba(66, 153, 225, 0.08);
    max-width: 240px;
    display: none;
    animation: slideInUp 0.4s ease-out;
    z-index: 999;
    border-left: 6px solid #4299e1;
    border-top: 1.5px solid #e2e8f0;
    max-height: calc(100vh - 160px - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition:
        box-shadow 0.3s,
        border-color 0.3s;
}

.resumen-afiliados-container.active {
    display: block;
    box-shadow:
        0 24px 48px 0 rgba(66, 153, 225, 0.18),
        0 2px 12px 0 rgba(67, 233, 123, 0.12);
    border-left: 6px solid #667eea;
}

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

.resumen-afiliado-display {
    text-align: left;
    font-size: clamp(11px, 1.8vw, 13px);
    font-weight: 500;
    color: #2d3748;
    line-height: 1.6;
    white-space: pre-line;
    padding: 12px;
    margin-bottom: 12px;
    background-color: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #4299e1;
}

.resumen-afiliado-display:first-child::before {
    content: '👥 Afiliados';
    display: block;
    font-size: 18px;
    color: #4299e1;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Error Popup Styles */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.error-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
    border-left: 5px solid #f56565;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.error-close:hover {
    color: #f56565;
}

.error-message {
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 24px;
    line-height: 1.6;
    padding-top: 10px;
}

.error-ok-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 101, 101, 0.3);
}

.error-ok-btn:active {
    transform: translateY(0);
}

@media (max-width: 1200px) {
    .container {
        margin-right: 0;
    }
    .price-container,
    .resumen-container,
    .resumen-afiliados-container {
        position: static;
        right: auto;
        top: auto;
        margin-top: 30px;
        min-width: auto;
        max-width: 100%;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        z-index: 1;
        display: none;
    }
    .price-container.active,
    .resumen-container.active,
    .resumen-afiliados-container.active {
        display: block;
    }
}

@media (max-width: 600px) {
    .auth-button-container {
        top: 8px;
        right: 8px;
    }

    .auth-button {
        padding: 8px 16px;
        font-size: 12px;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }

    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 26px;
    }

    .form-wrapper {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    button[type='submit'] {
        width: 100%;
    }
}
