/**
 * Archivo: /assets/css/register.css
 * Estilos para la página de registro con animaciones
 */

/* ===============================
   Layout Principal
   =============================== */
.register-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ===============================
   Lado Izquierdo - Slider
   =============================== */
.slider-side {
    position: relative;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide-image {
    position: absolute;
    inset: 0;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 6s ease;
    transform: scale(1.05);
}

.slide.active .slide-image img {
    transform: scale(1);
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(15, 20, 32, 0.4) 0%,
        rgba(15, 20, 32, 0.5) 50%,
        rgba(15, 20, 32, 0.9) 100%);
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    z-index: 5;
}

.slide-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-brand);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 30px rgba(233, 78, 27, 0.4);
}

.slide-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.slide-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
}

/* Logo del slider */
.slider-logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.slider-logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

/* Dots del slider */
.slider-dots {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.slider-dot {
    width: 32px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.3);
}

.slider-dot .dot-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--gradient-brand);
    border-radius: 2px;
}

.slider-dot.active .dot-progress {
    animation: dotProgress 5s linear forwards;
}

@keyframes dotProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* Footer del slider */
.slider-footer {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
}

.slider-footer .footer-mexico {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.slider-footer .footer-mexico img {
    width: 18px;
    height: auto;
}

/* ===============================
   Lado Derecho - Formulario
   =============================== */
.form-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 4rem;
    background: var(--dark);
    min-height: 100vh;
}

.form-side::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?w=1200&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
    filter: grayscale(100%) brightness(0.8);
}

.form-side::after {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--gradient-brand);
    opacity: 0.6;
    z-index: 1;
}

.form-container {
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.form-bg-texture {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.form-bg-texture .vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(15, 20, 32, 0.6) 100%);
}

/* Header del formulario */
.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ===============================
   Estilos del Formulario
   =============================== */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group label .required {
    color: var(--primary);
}

/* Input con wrapper para icono de estado */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-input {
    padding-right: 3rem;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7A90'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
    cursor: pointer;
}

.form-select option {
    background: var(--dark-surface);
    color: var(--text);
}

/* Input de teléfono */
.phone-input-group {
    display: flex;
    gap: 0.75rem;
}

.country-select-wrapper {
    position: relative;
    width: 120px;
    flex-shrink: 0;
}

.country-select {
    width: 100%;
    padding: 1rem 0.75rem;
    padding-left: 3rem;
    background: var(--dark-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7A90'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.country-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(233, 78, 27, 0.15);
    outline: none;
}

.country-flag {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 18px;
    border-radius: 3px;
    pointer-events: none;
    object-fit: cover;
}

.phone-input-group .form-input {
    flex: 1;
}

/* Input de contraseña */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 3.5rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle svg {
    width: 22px;
    height: 22px;
}

/* Indicador de fortaleza */
.password-strength-container {
    margin-top: -0.5rem;
}

.password-strength {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.weak { background: var(--error); }
.strength-bar.medium { background: #F59E0B; }
.strength-bar.strong { background: var(--success); }

.strength-text {
    font-size: 0.85rem;
    color: var(--text-subtle);
    margin-top: 0.35rem;
    display: block;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-input {
    width: 22px;
    height: 22px;
    margin-top: 1px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--primary-light);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ===============================
   Estados de Validación con Animación
   =============================== */

/* Icono de estado dentro del input */
.input-status {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Spinner de búsqueda/validación */
.input-status .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(233, 78, 27, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: inputSpin 0.7s linear infinite;
}

@keyframes inputSpin {
    to { transform: rotate(360deg); }
}

/* Icono de éxito */
.input-status .icon-success {
    color: var(--success);
    animation: iconPop 0.3s ease;
}

/* Icono de error */
.input-status .icon-error {
    color: var(--error);
    animation: iconPop 0.3s ease;
}

@keyframes iconPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.input-status svg {
    width: 20px;
    height: 20px;
}

/* Estados del input */
.form-input.validating {
    border-color: var(--primary);
    background: rgba(233, 78, 27, 0.03);
}

.form-input.valid {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.03);
}

.form-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-input.invalid {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.03);
}

.form-input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Mensaje de validación */
.validation-message {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    animation: fadeSlideIn 0.3s ease;
}

.validation-message svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.validation-message.success {
    color: var(--success);
}

.validation-message.error {
    color: var(--error);
}

.validation-message.checking {
    color: var(--text-subtle);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================
   Botón de Submit con Preloader
   =============================== */
.submit-btn {
    width: 100%;
    padding: 1.1rem 2rem;
    background: var(--gradient-brand);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(233, 78, 27, 0.3);
    margin-top: 0.75rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(233, 78, 27, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn svg {
    width: 22px;
    height: 22px;
}

/* Contenedor del texto y loader */
.submit-btn .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
}

.submit-btn .btn-loader {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

/* Estado de carga del botón */
.submit-btn.loading {
    pointer-events: none;
}

.submit-btn.loading .btn-content {
    opacity: 0;
    transform: translateY(-30px);
}

.submit-btn.loading .btn-loader {
    opacity: 1;
    transform: translateY(0);
}

/* Spinner del botón */
.submit-btn .btn-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Botón deshabilitado */
.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Efecto ripple */
.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:active:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

/* ===============================
   Animación de shake para errores
   =============================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ===============================
   Login Link
   =============================== */
.login-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.login-link p {
    color: var(--text-muted);
    font-size: 1rem;
}

.login-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* ===============================
   Footer del Formulario
   =============================== */
.form-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.form-footer .footer-mexico {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    margin-bottom: 1rem;
}

.form-footer .footer-mexico img {
    width: 22px;
    height: auto;
    border-radius: 2px;
}

.form-footer .footer-mexico span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-subtle);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-divider {
    color: var(--text-subtle);
    opacity: 0.5;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-subtle);
    opacity: 0.7;
}

/* ===============================
   Mobile Header
   =============================== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.back-btn {
    width: 44px;
    height: 44px;
    background: var(--dark-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.back-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.mobile-logo .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.mobile-logo .logo-text {
    font-size: 1.2rem;
}

/* ===============================
   Alertas
   =============================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeSlideIn 0.4s ease;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===============================
   Responsive
   =============================== */
@media (max-width: 1200px) {
    .form-side {
        padding: 2rem 3rem;
    }
}

@media (max-width: 1024px) {
    html, body {
        height: auto;
        overflow-y: auto;
    }

    .register-page {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .slider-side {
        display: none;
    }

    .form-side {
        padding: 2rem;
        overflow: visible;
        height: auto;
        min-height: 100vh;
    }

    .form-side::before {
        width: 100%;
        left: 0;
        right: 0;
        opacity: 0.05;
    }

    .form-side::after {
        display: none;
    }

    .form-bg-texture {
        width: 100%;
        left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .form-header {
        display: none;
    }

    .form-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-side {
        padding: 1.5rem;
        padding-bottom: 2rem;
    }

    .register-form {
        gap: 1rem;
    }

    .form-input {
        padding: 0.9rem 1rem;
    }

    .submit-btn {
        padding: 1rem 1.5rem;
    }

    .form-footer {
        margin-top: 2rem;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ===============================
   Animaciones de entrada
   =============================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group, .form-row {
    animation: fadeIn 0.4s ease backwards;
}

.form-row:nth-child(1) { animation-delay: 0.05s; }
.form-row:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }
.form-group:nth-child(5) { animation-delay: 0.25s; }
.form-row:nth-child(6) { animation-delay: 0.3s; }
.checkbox-group { animation: fadeIn 0.4s ease backwards; animation-delay: 0.35s; }
.submit-btn { animation: fadeIn 0.4s ease backwards; animation-delay: 0.4s; }
.login-link { animation: fadeIn 0.4s ease backwards; animation-delay: 0.45s; }
.form-footer { animation: fadeIn 0.4s ease backwards; animation-delay: 0.5s; }