* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.banner {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

h1 {
    color: #1e4d68;
    font-size: 2rem;
    margin-bottom: 10px;
}

h2 {
    color: #1e4d68;
    font-size: 1.6rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

h3 {
    color: #1e4d68;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.multi-step-form {
    position: relative;
}

.step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.step.active {
    display: block;
}

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

.step-content {
    padding: 20px 0;
}

.intro-text {
    background-color: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #1e4d68;
    margin-bottom: 30px;
    border-radius: 5px;
}

.intro-text p {
    margin-bottom: 15px;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1e4d68;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e4d68;
    box-shadow: 0 0 0 3px rgba(30, 77, 104, 0.1);
}

.form-group input:invalid,
.form-group select:invalid {
    border-color: #e74c3c;
}

.form-group input:valid,
.form-group select:valid {
    border-color: #27ae60;
}

/* Placeholder styles for date inputs */
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
}

/* Ensure all form controls have consistent styling */
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    font-family: 'Arial', sans-serif !important;
    font-size: 16px !important;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
}

.radio-group label:hover,
.checkbox-group label:hover {
    background-color: #f8f9fa;
}

.radio-group input,
.checkbox-group input {
    width: auto;
    margin-right: 10px;
    margin-bottom: 0;
}

.privacy-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin: 30px 0;
    border: 1px solid #ddd;
}

.privacy-text {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.programs-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    position: relative;
}

.selection-instruction {
    margin: 10px 0 20px 0;
    padding: 12px 16px;
    background-color: #e3f2fd;
    border: 1px solid #1976d2;
    border-radius: 8px;
    color: #0d47a1;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
}

.programs-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e4d68 0%, #2563eb 100%);
    border-radius: 12px 12px 0 0;
}

.programs-list {
    max-height: 450px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 4px;
}

.programs-list::-webkit-scrollbar {
    width: 8px;
}

.programs-list::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.programs-list::-webkit-scrollbar-thumb {
    background: #c4cdd5;
    border-radius: 4px;
}

.programs-list::-webkit-scrollbar-thumb:hover {
    background: #a8b4bc;
}

.program-item {
    border: 2px solid #e9ecef;
    border-radius: 16px;
    margin-bottom: 18px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.program-item:hover {
    border-color: #1e4d68;
    box-shadow: 0 8px 25px rgba(30,77,104,0.18);
    transform: translateY(-3px);
}

.program-item.selected {
    border-color: #1e4d68;
    background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
    box-shadow: 0 8px 25px rgba(30,77,104,0.22);
    transform: translateY(-2px);
}

.program-item.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1e4d68 0%, #2563eb 100%);
    border-radius: 16px 16px 0 0;
}

.program-card { 
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.program-header-with-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 20px 0 20px;
}

.program-checkbox-section {
    flex-shrink: 0;
    padding-top: 0;
}

.program-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.program-checkbox-label {
    cursor: pointer;
    display: inline-block;
    position: relative;
}

.checkbox-custom {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-custom:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.program-checkbox:checked + .program-checkbox-label .checkbox-custom {
    background-color: #007bff;
    border-color: #007bff;
}

.program-checkbox:checked + .program-checkbox-label .checkbox-custom::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.program-content { 
    padding: 0 20px 20px 20px;
    position: relative;
}

.program-header { 
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between;
    margin-bottom: 16px;
    flex: 1;
}

.program-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.program-selection-indicator {
    opacity: 0;
    transition: all 0.3s ease;
}

.program-item.selected .program-selection-indicator {
    opacity: 1;
}

.selection-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}
.program-code-badge {
    display: inline-block;
    min-width: 44px;
    padding: 6px 10px;
    background: #e6eef4;
    color: #1e4d68;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    letter-spacing: 0.4px;
}
.program-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: #0f2430;
}
.program-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 8px 0 10px;
}
.meta-item { display: flex; gap: 6px; align-items: baseline; }
.meta-label { color: #516b7a; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.meta-value { color: #1f2f38; font-size: 14px; }
.program-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e1e8ee;
    color: #2b4350;
    background: #f7fafc;
}
.tag--event { background: #fff7ed; border-color: #ffedd5; color: #9a3412; }
.tag--modality { background: #eef2ff; border-color: #e0e7ff; color: #3730a3; }

.program-objective {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}
.objective-label {
    color: #516b7a;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    display: block;
}
.objective-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

.btn-objective {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-objective:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #343a40;
}

.btn-objective.active {
    background: #1e4d68;
    border-color: #1e4d68;
    color: white;
}

.program-name {
    margin-top: 5px;
    font-size: 16px;
}

.selection-note {
    font-style: italic;
    color: #666;
    margin-top: 10px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-small { padding: 8px 14px; font-size: 14px; font-family: 'Arial', sans-serif; }

.inline-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.help-text {
    margin-top: 6px;
    font-size: 13px;
    font-family: 'Arial', sans-serif;
    color: #516b7a;
}

.help-text.success { color: #1b7f41; }
.help-text.error { color: #b42318; }
.help-text.muted { color: #6b7280; }

.btn-primary {
    background-color: #1e4d68;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5a7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-primary:disabled,
.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.full-width {
    width: 100%;
    margin-top: 20px;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.step-indicator {
    display: flex;
    gap: 10px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: default;
    transition: background-color 0.3s ease;
}

.step-dot.active {
    background-color: #1e4d68;
}

.step-dot.completed {
    background-color: #27ae60;
}

.success-message {
    text-align: center;
    padding: 40px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    color: #155724;
}

.success-message h2 {
    color: #155724;
    margin-bottom: 15px;
}

.hidden {
    display: none;
}

/* City Input Click to Open */
.form-group input[name="ciudad"] {
    cursor: pointer;
}

.form-group input[name="ciudad"]:disabled {
    cursor: not-allowed;
}

/* City Search Popup */
.city-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.city-popup-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.city-popup-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.city-popup-header h3 {
    margin: 0;
    color: #1e4d68;
    font-size: 1.3rem;
}

.close-popup-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-popup-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.city-search-container {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.city-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.city-search-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.city-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 200px;
    max-height: 300px;
}

.city-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 15px;
}

.city-item:hover {
    background: #f3f4f6;
    color: #0066cc;
}

.city-item:active {
    background: #e5f3ff;
}

.no-cities {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-style: italic;
}

/* Mobile responsiveness for popup */
@media (max-width: 768px) {
    .city-popup {
        padding: 10px;
    }
    
    .city-popup-content {
        max-height: 90vh;
    }
    
    .city-popup-header,
    .city-search-container {
        padding: 15px;
    }
    
    .city-list {
        max-height: 250px;
    }
}

/* Enhanced Program Selection Styles */
.program-details {
    margin-top: 8px;
}

.program-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px 20px;
    margin: 16px 0;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.meta-item { 
    display: flex; 
    flex-direction: column;
    gap: 4px;
}

.meta-label { 
    color: #6b7280; 
    font-size: 11px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.meta-value { 
    color: #111827; 
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.program-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin: 16px 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.tag--event { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
}

.tag--modality { 
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #6d28d9;
    border-color: #8b5cf6;
}

.program-objective-section {
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.objective-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.objective-label {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

/* Material Design Objective Button */
.btn-objective-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1976d2;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    outline: none;
    min-height: 36px;
}

/* Material ripple effect */
.btn-objective-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    border-radius: inherit;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.btn-objective-toggle:hover {
    background: #1565c0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.btn-objective-toggle:hover::before {
    transform: scale(1);
}

.btn-objective-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-objective-toggle.expanded {
    background: #d32f2f;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-objective-toggle.expanded:hover {
    background: #c62828;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    position: relative;
}

.btn-objective-toggle.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Focus states for accessibility */
.btn-objective-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.5), 0 2px 4px rgba(0,0,0,0.2);
}

.btn-objective-toggle.expanded:focus-visible {
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.5), 0 2px 4px rgba(0,0,0,0.2);
}

.program-objective {
    margin-top: 16px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

/* Selection Counter */
.selection-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f9ff 100%);
    border: 1px solid #b6e1f0;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1e4d68;
}

.selection-counter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #1e4d68;
    color: white;
    border-radius: 50%;
    font-size: 12px;
}

.selection-counter.max-reached {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.selection-counter.max-reached .selection-counter-icon {
    background: #f59e0b;
}

.objective-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #424242;
    text-align: justify;
    font-weight: 400;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form-group.error input,
.form-group.error select {
    border-color: #e74c3c;
}

.form-group.error .error-message {
    display: block;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e4d68;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .radio-group,
    .checkbox-group {
        gap: 8px;
    }
    
    .program-item { 
        padding: 12px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .program-meta-grid { grid-template-columns: 1fr; }
    .program-content { padding: 16px; }
    .program-header { margin-bottom: 12px; }
    
    .intro-text,
    .privacy-section {
        padding: 15px;
    }
    
    .programs-section {
        padding: 18px;
        margin: 16px 0;
    }
    
    .programs-list {
        max-height: 350px;
        padding: 2px;
    }
    
    .selection-counter {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .btn-objective-toggle {
        padding: 6px 12px;
        font-size: 11px;
        min-height: 32px;
        gap: 6px;
    }
    
    .program-objective {
        padding: 16px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }
}
