/* ============================================
   MATRICULA PAGE - I.E.P.E. Apóstol Pablo
   Wizard de 3 pasos para matricula
   ============================================ */

.matricula-page {
    padding: 0.5rem;
    max-width: 100%;
    margin: 0;
}

/* ============================================
   WIZARD CONTAINER
   ============================================ */
.wizard-container {
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 1rem;
}

/* ============================================
   STEPPER (Indicador de pasos)
   ============================================ */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #a0aec0;
    transition: all 0.3s ease;
}

.step-circle svg {
    width: 14px;
    height: 14px;
}

.step.active .step-circle {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.step.completed .step-circle {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #718096;
    text-align: center;
    max-width: 80px;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--color-primary);
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    margin-bottom: 1rem;
    max-width: 80px;
    transition: background 0.3s ease;
}

.step-line.completed {
    background: var(--color-primary);
}

/* ============================================
   WIZARD CONTENT
   ============================================ */
.wizard-content {
    min-height: auto;
}

.step-content {
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   CHECKBOX ROW (Alumno nuevo / Apoderado nuevo)
   ============================================ */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-dark);
    user-select: none;
}

.custom-checkbox input[type="checkbox"] {
    display: none;
}

.custom-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-primary);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--color-primary);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.search-select {
    flex: 1;
    min-width: 200px;
}

/* ============================================
   FORM GRID
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem 0.75rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-dark);
}

/* ============================================
   FORM INPUTS
   ============================================ */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.85rem;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 85, 163, 0.1);
}

.form-input::placeholder {
    color: #a0aec0;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   INPUT WITH CLEAR BUTTON
   ============================================ */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-clear .form-input {
    padding-right: 2.5rem;
}

.btn-clear {
    position: absolute;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    border: none;
    background: #e2e8f0;
    color: #718096;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: #cbd5e0;
    color: #4a5568;
}

/* ============================================
   FILE INPUT
   ============================================ */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-file {
    padding: 0.6rem 1rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-file:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-file input[type="file"] {
    display: none;
}

.file-name {
    font-size: 0.85rem;
    color: #718096;
}

/* ============================================
   CHECKBOX TRANSPORT
   ============================================ */
.checkbox-transport {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.form-actions .btn {
    min-width: 90px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.form-actions .btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.form-actions .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   SEARCHING INDICATOR
   ============================================ */
.searching-indicator {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-primary);
    margin-left: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   SPINNER
   ============================================ */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1200px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .matricula-page {
        padding: 0.5rem;
    }

    .wizard-container {
        padding: 0.75rem 1rem;
    }

    .step-line {
        max-width: 80px;
    }

    .step-label {
        font-size: 0.75rem;
        max-width: 90px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .matricula-page {
        padding: 0.5rem;
    }

    .wizard-container {
        padding: 0.75rem;
        border-radius: 8px;
    }

    .stepper {
        flex-wrap: wrap;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
    }

    .step-line {
        display: none;
    }

    .step {
        flex: 1;
        min-width: 70px;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

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

    .checkbox-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .search-select {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    .file-input-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   RESPONSIVE - MOBILE SMALL
   ============================================ */
@media (max-width: 480px) {
    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .step-label {
        font-size: 0.6rem;
    }

    .form-input,
    .form-select {
        padding: 0.45rem 0.65rem;
        font-size: 0.85rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }
}
