/* Register Page - Simple & Clean */

/* Layout */
.register-page-body {
    background: #f8f9fa;
    font-family: 'Poppins', sans-serif;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-page-container {
    max-width: 600px;
    width: 100%;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    width: 80%;
    margin: 0 auto 2rem auto;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e9ecef;
    z-index: 1;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6c757d;
    position: relative;
    z-index: 2;
}

.progress-step.is-active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.progress-step::after {
    content: attr(data-title);
    position: absolute;
    top: 50px;
    font-size: 0.8rem;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
}

/* Card */
.register-form-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: none;
}

/* Steps */
.form-step {
    display: none;
}

.form-step.is-active {
    display: block;
}

/* Headers */
.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #343a40;
    margin: 0 0 0.5rem 0;
}

.step-description {
    color: #6c757d;
    margin: 0;
}

/* Form */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field {
    flex: 1;
}

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #343a40;
}

.field-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.field-input:focus {
    outline: none;
    border-color: #007bff;
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Input Group */
.input-group {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: #007bff;
}

.input-group__prefix {
    background: #f8f9fa;
    padding: 0.75rem;
    border: none;
    color: #6c757d;
}

.input-group__input {
    border: none;
    border-radius: 0;
}

.input-group__input:focus {
    border: none;
}

/* Avatar Upload */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.avatar-upload-area {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-upload-area:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.avatar-upload-area i {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.avatar-upload-area span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
}

.file-input-hidden {
    display: none;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-input {
    margin: 0;
    transform: scale(1.2);
}

.checkbox-label {
    margin: 0;
    line-height: 1.4;
}

/* Buttons */
.step-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.step-actions--single {
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

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

/* Divider */
.form-divider {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 2rem 0;
}

/* Mobile */
@media (max-width: 768px) {
    .register-page-body {
        padding: 1rem;
    }

    .register-form-card {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    .avatar-upload-section {
        flex-direction: column;
        text-align: center;
    }

    .step-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================================
   USERNAME VALIDATION - FORCED COLORS
   Estilos para mensajes de validación de username
   =========================================== */

/* --- ESTILOS GENERALES PARA VALIDACIÓN --- */
.validation-message {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
}

/* --- USERNAME NO DISPONIBLE (ROJO) --- */
.validation-message.unavailable,
.validation-message[data-available="false"],
.username-unavailable {
    color: var(--color-accent-red) !important;
    background-color: #fbebee !important;
    border: 1px solid #f5c6cb !important;
}

/* --- USERNAME DISPONIBLE (AZUL) --- */
.validation-message.available,
.validation-message[data-available="true"],
.username-available {
    color: var(--color-primary) !important;
    background-color: #eef4ff !important;
    border: 1px solid #b8d4fe !important;
}

/* --- FORZAR COLORES CON SELECTORES ESPECÍFICOS --- */
/* Para mensajes que contengan texto específico */
.validation-message:contains("already taken"),
.validation-message:contains("This username is already taken") {
    color: var(--color-accent-red) !important;
    background-color: #fbebee !important;
}

.validation-message:contains("available"),
.validation-message:contains("Username is available") {
    color: var(--color-primary) !important;
    background-color: #eef4ff !important;
}

/* --- ALTERNATIVA: CLASES DIRECTAS PARA APLICAR EN JS --- */
.text-error {
    color: var(--color-accent-red) !important;
    background-color: #fbebee !important;
    border: 1px solid #f5c6cb !important;
}

.text-success {
    color: var(--color-primary) !important;
    background-color: #eef4ff !important;
    border: 1px solid #b8d4fe !important;
}

/* --- ESTILOS PARA DIFERENTES CONTENEDORES --- */
/* Si está dentro de un form-group */
.form-group .validation-message.unavailable,
.form-group .text-error {
    color: var(--color-accent-red) !important;
}

.form-group .validation-message.available,
.form-group .text-success {
    color: var(--color-primary) !important;
}

/* --- PARA ALERTAS GENERALES --- */
.alert.username-validation {
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-xs);
    font-weight: var(--font-weight-semibold);
}

.alert.username-validation.error {
    background-color: #fbebee !important;
    color: var(--color-accent-red) !important;
    border: 1px solid #f5c6cb !important;
}

.alert.username-validation.success {
    background-color: #eef4ff !important;
    color: var(--color-primary) !important;
    border: 1px solid #b8d4fe !important;
}

/* Progress Bar - VERSIÓN CORREGIDA */
.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem auto;
    position: relative;
    width: 100%;
    max-width: 400px;
    /* Controla el ancho máximo */
    padding: 0 2rem;
    /* Espacio en los lados para que no se pegue a los bordes */
}

/* Línea de progreso */
.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 2rem;
    right: 2rem;
    height: 3px;
    background: #e9ecef;
    transform: translateY(-50%);
    z-index: 1;
}

/* Línea de progreso activa (si la usas) */
.progress-bar__line {
    position: absolute;
    top: 50%;
    left: 2rem;
    height: 3px;
    background: #007bff;
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.3s ease;
    width: 0%;
    /* Se actualiza con JavaScript */
}

/* Pasos del progreso */
.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6c757d;
    position: relative;
    z-index: 2;
    transition: all 0.2s ease;
}

.progress-step.is-active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Títulos debajo de cada paso */
.progress-step::after {
    content: attr(data-title);
    position: absolute;
    top: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
    color: #6c757d;
}

.progress-step.is-active::after {
    color: #007bff;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .progress-bar {
        max-width: 300px;
        padding: 0 1rem;
    }

    .progress-bar::before {
        left: 1rem;
        right: 1rem;
    }

    .progress-bar__line {
        left: 1rem;
    }

    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .progress-step::after {
        font-size: 0.75rem;
        top: 45px;
    }
}