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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef5 100%);
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

/* ============================================
   HEADER SECTION
   ============================================ */

.page-header {
    background-color: #183059;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 0.875rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
}

.header-logo-box {
    background-color: white;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(24, 48, 89, 0.12);
}

.header-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.header-logo-text {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 700;
    color: #183059;
    letter-spacing: -0.03em;
    padding-right: 0.5rem;
}

.header-info h1 {
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 600;
    color: white;
    margin: 0;
}

.header-info p {
    font-size: clamp(0.75rem, 1.8vw, 0.813rem);
    color: rgba(255, 255, 255, 0.9);
    margin: 0.125rem 0 0 0;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(0.875rem, 2.5vw, 1.5rem) clamp(0.75rem, 2vw, 1.25rem);
}

.main-header {
    background: white;
    color: #183059;
    padding: clamp(1.25rem, 3vw, 1.75rem) 1.25rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.main-header h1 {
    font-size: clamp(1.375rem, 3.5vw, 1.625rem);
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.03em;
}

.main-header p {
    font-size: clamp(0.813rem, 2.2vw, 0.875rem);
    color: #64748b;
    margin: 0;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.nav-container {
    background: white;
    border-radius: 10px;
    padding: 1.125rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.progress-bar-container {
    position: relative;
    height: 3px;
    background: #e2e8f0;
    border-radius: 1.5px;
    margin-bottom: 1.125rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #183059;
    border-radius: 1.5px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    padding-top: 1.25rem;
}

.nav-tabs::-webkit-scrollbar {
    height: 6px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.625rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    min-width: 95px;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    text-decoration: none;
    position: relative;
}

.nav-tab:hover:not(:disabled) {
    border-color: #183059;
    background-color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 48, 89, 0.08);
}

.nav-tab.active {
    background: #183059;
    border-color: #183059;
    color: white;
    box-shadow: 0 4px 12px rgba(24, 48, 89, 0.25);
    position: relative;
}

.nav-tab.active::after {
    content: '';
    display: none;
}

.nav-tab.completed {
    background: white;
    border-color: #22c55e;
    color: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
    position: relative;
}

.nav-tab.completed::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #22c55e;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.nav-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
    transform: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 0.25rem;
    fill: currentColor;
    flex-shrink: 0;
}

.nav-text {
    font-size: 0.688rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

/* ============================================
   FORM CONTENT
   ============================================ */

.form-content {
    background: white;
    border-radius: 10px;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.info-alert {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #1e40af;
    font-size: 0.875rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.info-alert::before {
    content: '';
    flex-shrink: 0;
    font-size: 1.25rem;
}

/* ============================================
   TOKEN SECTION
   ============================================ */

.token-section {
    background: #fefce8;
    border-left: 3px solid #eab308;
    border-radius: 6px;
    padding: 1rem 1.125rem;
    margin-bottom: 1.25rem;
}

.token-section h3 {
    color: #713f12;
    margin-bottom: 0.625rem;
    font-size: 0.938rem;
    font-weight: 600;
}

.token-section p {
    color: #854d0e;
    margin: 0 0 0.75rem 0;
    font-size: 0.813rem;
}

.token-input-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.token-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #fbbf24;
    border-radius: 6px;
    font-size: 0.813rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.token-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.token-btn {
    padding: 0.625rem 1.25rem;
    background: #eab308;
    color: #1e293b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.813rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.token-btn:hover:not(:disabled) {
    background: #ca8a04;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(234, 179, 8, 0.25);
}

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

/* ============================================
   SECTION TITLES
   ============================================ */

.section-title {
    color: #183059;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-bottom: 0.625rem;
    border-bottom: 1.5px solid #e2e8f0;
}

.section-icon {
    width: 22px;
    height: 22px;
    fill: #183059;
    flex-shrink: 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.813rem;
    letter-spacing: 0.01em;
}

.form-label.required::after {
    content: ' *';
    color: #dc2626;
    font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.813rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white;
    font-family: inherit;
    color: #1e293b;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: #f8fafc;
    cursor: not-allowed;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #183059;
    box-shadow: 0 0 0 3px rgba(24, 48, 89, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

/* ============================================
   CHECKBOX & RADIO GRIDS
   ============================================ */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 0.625rem;
    margin-top: 0.625rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: #f8fafc;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.813rem;
    color: #334155;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.checkbox-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #183059;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   ENROLLMENT BANNER
   ============================================ */

.enrollment-banner {
    background-color: #183059;
    border-radius: 10px;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(24, 48, 89, 0.18);
}

.enrollment-banner h3 {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    margin-bottom: 1.25rem;
    text-align: center;
    font-weight: 600;
}

.enrollment-images {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.image-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.4);
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.image-card img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 4px;
}

.image-card span {
    color: #183059;
    font-weight: 600;
    font-size: 0.813rem;
    text-align: center;
}

/* ============================================
   STUDENT INFO GRID
   ============================================ */

.student-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 0.875rem;
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.625rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.875rem;
    color: #183059;
    font-weight: 600;
}

/* ============================================
   CHECKBOX & RADIO GROUPS
   ============================================ */

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-top: 0.625rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-input,
.radio-input {
    width: 16px;
    height: 16px;
    accent-color: #183059;
    cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 0.875rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1.5px solid #e2e8f0;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-width: 130px;
    letter-spacing: 0.01em;
}

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

.btn-primary {
    background: #183059;
    color: white;
    box-shadow: 0 2px 4px rgba(24, 48, 89, 0.12);
}

.btn-primary:hover:not(:disabled) {
    background: #0f1f3d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 48, 89, 0.25);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* ============================================
   LOADING & MESSAGES
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 45px;
    height: 45px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #183059;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.error-input {
    border-color: #ef4444 !important;
    background-color: #fee2e2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #fecaca;
    border-left: 3px solid #dc2626;
    border-radius: 4px;
}

.success-check {
    color: #16a34a;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #dcfce7;
    border-left: 3px solid #16a34a;
    border-radius: 4px;
}

/* Ayuda/Hint debajo de campos */
.field-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Indicador de campo completado */
.field-complete {
    color: #16a34a;
    font-weight: bold;
}

/* Estilos mejorados para inputs */
.form-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(24, 48, 89, 0.1);
}

/* ============================================
   SWEETALERT2 CUSTOM STYLES
   ============================================ */

.swal2-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    border-radius: 10px !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12) !important;
}

.swal2-icon.swal2-warning,
.swal2-icon.swal2-info,
.swal2-icon.swal2-success,
.swal2-icon.swal2-error {
    background: #f1f5f9;
    color: #183059;
    box-shadow: none;
}

.swal2-title {
    color: #183059;
    font-weight: 700;
    font-size: 1.375rem;
}

.swal2-html-container {
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.5;
}

.swal2-confirm {
    background: #183059 !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(24, 48, 89, 0.25) !important;
    padding: 0.625rem 1.375rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    font-size: 0.813rem !important;
}

.swal2-confirm:hover {
    background: #0f1f3d !important;
    transform: translateY(-1px);
}

.swal2-cancel {
    background: white !important;
    color: #64748b !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 0.625rem 1.375rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    font-size: 0.813rem !important;
}

.swal2-cancel:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }

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

    .nav-container {
        padding: 1rem;
    }

    .nav-tabs {
        gap: 0.5rem;
        padding-top: 1rem;
    }

    .nav-tab {
        min-width: 100px;
        padding: 0.875rem 0.625rem;
        flex: 0 0 calc(50% - 0.25rem);
    }

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

    .nav-text {
        font-size: 0.688rem;
    }

    .form-content {
        padding: 1.25rem;
    }

    .button-group {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        min-width: unset;
    }

    .enrollment-banner {
        padding: 1.25rem;
    }

    .enrollment-images {
        flex-direction: column;
        gap: 1rem;
    }

    .student-info-grid {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .token-input-group {
        flex-direction: column;
        gap: 0.625rem;
    }

    .token-btn {
        width: 100%;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        flex: 0 0 calc(33.333% - 0.35rem);
        min-width: 85px;
        padding: 0.75rem 0.5rem;
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }

    .nav-text {
        font-size: 0.625rem;
    }

    .header-logo-box {
        min-width: 42px;
        height: 42px;
    }

    .section-title {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .section-icon {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.nav-tab:focus-visible,
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
    outline: 3px solid #183059;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {

    .nav-tab,
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 3px;
    }
}