/* =========================================
   DISEÑO PROFESIONAL - LOGIN & REGISTER
   ========================================= */

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

body.auth-page {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    background: linear-gradient(135deg, #111316 0%, #1e1e1e 50%, #111316 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}


/* Fondo animado */
body.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 31, 46, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 214, 0, 0.1) 0%, transparent 50%);
    animation: backgroundShift 15s ease-in-out infinite;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Contenedor principal */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease;
    margin: 0 auto;
}

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

/* Card principal */
.auth-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(17, 19, 22, 0.98) 100%);
    border: 2px solid rgba(255, 31, 46, 0.2);
    border-radius: 24px;
    padding: 0;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 31, 46, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
}

@media (max-width: 576px) {
    .auth-card {
        border-radius: 16px;
        border-width: 1.5px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        border-radius: 12px;
        border-width: 1px;
    }
}

/* Header del card */
.auth-header {
    background: linear-gradient(135deg, var(--bx-brand) 0%, var(--bx-brand-hover) 100%);
    padding: 40px 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 576px) {
    .auth-header {
        padding: 30px 20px 25px;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 25px 15px 20px;
    }
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--bx-yellow);
    box-shadow: 0 0 20px var(--bx-yellow);
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    animation: logoFloat 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

@media (max-width: 576px) {
    .auth-logo {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .auth-logo img {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .auth-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
        border-width: 2px;
    }
    
    .auth-logo img {
        width: 40px;
        height: 40px;
    }
}

.auth-title {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-top: 8px;
    font-weight: 400;
}

@media (max-width: 576px) {
    .auth-title {
        font-size: 1.6rem;
        letter-spacing: 1.5px;
    }
    
    .auth-subtitle {
        font-size: 0.85rem;
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    .auth-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .auth-subtitle {
        font-size: 0.8rem;
        margin-top: 5px;
    }
}

/* Body del card */
.auth-body {
    padding: 40px;
}

@media (max-width: 576px) {
    .auth-body {
        padding: 30px 25px;
    }
}

@media (max-width: 480px) {
    .auth-body {
        padding: 25px 20px;
    }
}

/* Mensajes de error/éxito */
.auth-message {
    background: linear-gradient(135deg, rgba(255, 31, 46, 0.15) 0%, rgba(255, 31, 46, 0.05) 100%);
    border: 1px solid rgba(255, 31, 46, 0.3);
    border-left: 4px solid var(--bx-brand);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    color: #ff6b6b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: shake 0.5s ease;
    word-wrap: break-word;
}

@media (max-width: 576px) {
    .auth-message {
        padding: 12px 16px;
        font-size: 0.85rem;
        gap: 10px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .auth-message i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .auth-message {
        padding: 10px 14px;
        font-size: 0.8rem;
        gap: 8px;
        margin-bottom: 18px;
        border-radius: 8px;
        flex-wrap: wrap;
    }
    
    .auth-message i {
        font-size: 1rem;
    }
    
    .auth-message span {
        flex: 1;
        min-width: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.auth-message i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Formulario */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (max-width: 576px) {
    .auth-form {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .auth-form {
        gap: 18px;
    }
}

/* Input groups */
.auth-input-group {
    position: relative;
}

.auth-input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
    pointer-events: none;
}

.auth-input-group input {
    width: 100%;
    background: rgba(17, 19, 22, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 18px 16px 50px;
    color: white;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    z-index: 1;
}

/* Input con password toggle necesita más padding-right */
.auth-input-group-password input,
.auth-input-group:has(.password-toggle) input {
    padding-right: 50px;
}

@media (max-width: 576px) {
    .auth-input-group input {
        padding: 14px 16px 14px 48px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    .auth-input-group-password input,
    .auth-input-group:has(.password-toggle) input {
        padding-right: 48px;
    }
    
    .auth-input-group i {
        left: 16px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-input-group input {
        padding: 12px 14px 12px 45px;
        font-size: 0.9rem;
        border-radius: 8px;
        border-width: 1.5px;
    }
    
    .auth-input-group-password input,
    .auth-input-group:has(.password-toggle) input {
        padding-right: 45px;
    }
    
    .auth-input-group i {
        left: 14px;
        font-size: 0.95rem;
    }
    
    .password-toggle {
        right: 14px;
        font-size: 1rem;
        padding: 6px;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
}

.auth-input-group input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

.auth-input-group input:focus {
    border-color: var(--bx-brand);
    background: rgba(17, 19, 22, 0.95);
    box-shadow: 
        0 0 0 4px rgba(255, 31, 46, 0.1),
        0 0 20px rgba(255, 31, 46, 0.2);
    transform: translateY(-2px);
}

/* Evitar que el texto se solape con el toggle */
.auth-input-group-password input,
.auth-input-group:has(.password-toggle) input {
    text-overflow: ellipsis;
    overflow: hidden;
}

.auth-input-group input:focus + i,
.auth-input-group input:not(:placeholder-shown) + i {
    color: var(--bx-brand);
}

/* Botón de submit */
.auth-submit-btn {
    background: linear-gradient(135deg, var(--bx-brand) 0%, var(--bx-brand-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 31, 46, 0.4);
    width: 100%;
}

@media (max-width: 576px) {
    .auth-submit-btn {
        padding: 16px;
        font-size: 1rem;
        letter-spacing: 1px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .auth-submit-btn {
        padding: 14px;
        font-size: 0.95rem;
        letter-spacing: 0.5px;
        border-radius: 8px;
    }
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.auth-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 31, 46, 0.6);
}

.auth-submit-btn:active {
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Link de cambio */
.auth-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-link-text {
    color: #8D99AE;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.auth-link a {
    color: var(--bx-yellow);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 576px) {
    .auth-link {
        margin-top: 25px;
        padding-top: 20px;
    }
    
    .auth-link-text {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .auth-link a {
        font-size: 0.9rem;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .auth-link {
        margin-top: 20px;
        padding-top: 18px;
    }
    
    .auth-link-text {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .auth-link a {
        font-size: 0.85rem;
        gap: 5px;
    }
    
    .auth-link a i {
        font-size: 0.8rem;
    }
}

.auth-link a:hover {
    color: var(--bx-yellow-hover);
    text-shadow: 0 0 10px rgba(255, 214, 0, 0.5);
    transform: translateX(5px);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 100;
    padding: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    outline: none;
}

.password-toggle:hover {
    color: var(--bx-brand);
    background: rgba(255, 31, 46, 0.1);
}

.password-toggle:focus {
    outline: 2px solid var(--bx-brand);
    outline-offset: 2px;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 31, 46, 0.2);
}

.password-toggle i {
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Loading spinner */
.auth-submit-btn.loading {
    pointer-events: none;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* Tablets */
@media (max-width: 768px) {
    body.auth-page {
        padding: 15px;
    }
    
    .auth-container {
        max-width: 420px;
    }
    
    .auth-card {
        border-radius: 20px;
    }
}

/* Móviles grandes */
@media (max-width: 576px) {
    body.auth-page {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .auth-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }
    
    .auth-card {
        border-radius: 16px;
        border-width: 1.5px;
    }
    
    /* Ajustar hover en móviles */
    .auth-submit-btn:hover {
        transform: none;
    }
    
    .auth-link a:hover {
        transform: none;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    body.auth-page {
        padding: 10px 5px;
        padding-top: 15px;
    }
    
    .auth-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }
    
    .auth-card {
        border-radius: 12px;
        border-width: 1px;
    }
    
    /* Desactivar transformaciones en móviles muy pequeños */
    .auth-input-group input:focus {
        transform: none;
    }
    
    .auth-submit-btn:hover {
        transform: none;
    }
}
/* Móviles pequeños */
@media (max-width: 480px) {
    body.auth-page {
        padding: 10px 5px;
        padding-top: 15px;
    }
    
    .auth-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }
    
    .auth-card {
        border-radius: 12px;
        border-width: 1px;
    }
    
    /* Desactivar transformaciones en móviles muy pequeños */
    .auth-input-group input:focus {
        transform: none;
    }
    
    .auth-submit-btn:hover {
        transform: none;
    }
}

/* Responsive - Pantallas muy pequeñas */
@media (max-width: 360px) {
    body.auth-page {
        padding: 5px;
        padding-top: 10px;
    }
    
    .auth-header {
        padding: 20px 12px 18px;
    }
    
    .auth-logo {
        width: 55px;
        height: 55px;
        margin-bottom: 10px;
    }
    
    .auth-logo img {
        width: 35px;
        height: 35px;
    }
    
    .auth-title {
        font-size: 1.2rem;
        letter-spacing: 0.5px;
    }
    
    .auth-subtitle {
        font-size: 0.75rem;
    }
    
    .auth-body {
        padding: 20px 15px;
    }
    
    .auth-form {
        gap: 15px;
    }
    
    .auth-input-group input {
        padding: 10px 12px 10px 40px;
        font-size: 0.85rem;
    }
    
    .auth-input-group-password input,
    .auth-input-group:has(.password-toggle) input {
        padding-right: 40px;
    }
    
    .auth-input-group i {
        left: 12px;
        font-size: 0.9rem;
    }
    
    .password-toggle {
        right: 12px;
        font-size: 0.9rem;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        padding: 8px;
    }
    
    .auth-submit-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .auth-message {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* Efectos adicionales */
.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 31, 46, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

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

