/* ============================================
   Página de Login - Sistema Clínica
   Diseño Premium UX/UI
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.login-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    max-height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 50%, #0d7377 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Partículas de fondo */
.login-page::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.login-wrapper {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    max-height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin: 0 auto;
}

/* ============================================
   Panel Izquierdo - Información
   ============================================ */

.login-info-panel {
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.98) 0%, rgba(236, 253, 245, 0.98) 100%);
    backdrop-filter: blur(10px);
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(13, 115, 119, 0.15);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-info-panel::-webkit-scrollbar {
    width: 6px;
}

.login-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.login-info-panel::-webkit-scrollbar-thumb {
    background: rgba(13, 115, 119, 0.2);
    border-radius: 10px;
}

.login-info-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 115, 119, 0.3);
}

.info-content {
    position: relative;
    z-index: 2;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.info-content::-webkit-scrollbar {
    width: 4px;
}

.info-content::-webkit-scrollbar-track {
    background: transparent;
}

.info-content::-webkit-scrollbar-thumb {
    background: rgba(13, 115, 119, 0.2);
    border-radius: 10px;
}

.info-logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.logo-icon-wrapper {
    width: 65px;
    height: 65px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(13, 115, 119, 0.4);
    animation: pulse 3s ease-in-out infinite;
    position: relative;
}

.logo-icon-wrapper::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    opacity: 0.5;
    animation: ripple 2s ease-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.info-logo h1 {
    font-size: 1.625rem;
    color: #0d7377;
    margin-bottom: 0.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

.info-features {
    margin-bottom: 1.25rem;
}

.feature-item {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 0.75rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid rgba(13, 115, 119, 0.1);
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.05);
}

.feature-item:hover {
    background: rgba(13, 115, 119, 0.08);
    border-color: rgba(13, 115, 119, 0.2);
    transform: translateX(5px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
}

.feature-content h3 {
    color: #1f2937;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.feature-content p {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.4;
}

.info-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-box {
    text-align: center;
    padding: 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(13, 115, 119, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.08);
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 115, 119, 0.2);
    border-color: rgba(13, 115, 119, 0.3);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d7377;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Iconos flotantes decorativos */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-icon {
    position: absolute;
    color: rgba(13, 115, 119, 0.1);
    font-size: 3rem;
    animation: floatIcon 15s ease-in-out infinite;
}

.floating-icon.icon-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon.icon-2 {
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

.floating-icon.icon-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 6s;
}

.floating-icon.icon-4 {
    top: 30%;
    right: 10%;
    animation-delay: 9s;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.1;
    }
    25% {
        transform: translate(20px, -20px) rotate(90deg);
        opacity: 0.15;
    }
    50% {
        transform: translate(-10px, -40px) rotate(180deg);
        opacity: 0.1;
    }
    75% {
        transform: translate(-20px, -20px) rotate(270deg);
        opacity: 0.15;
    }
}

/* ============================================
   Panel Derecho - Formulario
   ============================================ */

.login-form-panel {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    position: relative;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 1.75rem;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.6s ease-out;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.header-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 0.875rem;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.625rem;
    box-shadow: 0 8px 20px rgba(13, 115, 119, 0.3);
}

.login-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Alertas mejoradas */
.alert {
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: slideDown 0.3s ease;
    position: relative;
    border-left: 4px solid;
    flex-shrink: 0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.alert-content strong {
    font-weight: 600;
    font-size: 0.85rem;
}

.alert-content span {
    font-size: 0.8rem;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    opacity: 0.7;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    flex: 1;
    min-height: 0;
}

.login-form::-webkit-scrollbar {
    width: 6px;
}

.login-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.login-form::-webkit-scrollbar-thumb {
    background: #0d7377;
    border-radius: 10px;
}

.login-form::-webkit-scrollbar-thumb:hover {
    background: #14a085;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex-shrink: 0;
}

.input-label {
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label i {
    color: #0d7377;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #1f2937;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #0d7377;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.1);
}

.form-input:focus + .input-focus-line {
    width: 100%;
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 3.5rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.toggle-password:hover {
    color: #0d7377;
    background: rgba(13, 115, 119, 0.1);
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    width: 0%;
    transition: width 0.3s ease;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
    flex-shrink: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: #ffffff;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    border-color: #0d7377;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #ffffff;
    font-size: 0.75rem;
}

.checkbox-text {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password {
    color: #0d7377;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #14a085;
    text-decoration: underline;
}

/* Botón de login mejorado */
.btn-login {
    margin-top: 0.375rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #0d7377 0%, #14a085 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 115, 119, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.loading {
    pointer-events: none;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-loader {
    position: relative;
    z-index: 1;
}

.btn-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

/* Footer compacto */
.login-footer-compact {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.quick-access-compact {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.quick-btn-compact {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1rem;
}

.quick-btn-compact:hover {
    background: rgba(13, 115, 119, 0.05);
    border-color: #0d7377;
    color: #0d7377;
    transform: translateY(-2px);
}

.copyright-compact {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.copyright-compact i {
    color: #10b981;
    font-size: 0.7rem;
}

/* Animaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Responsive
   ============================================ */

/* Desktop por defecto - dos columnas */
@media (min-width: 1025px) {
    .login-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    
    .login-info-panel {
        display: flex;
    }
}

/* Tablet y móvil - una columna */
@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        height: 100vh;
    }
    
    .login-info-panel {
        display: none;
    }
    
    .login-form-panel {
        height: 100vh;
        max-height: 100vh;
    }
    
    .login-card {
        max-height: calc(100vh - 2rem);
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 2rem;
    }
    
    .login-header h2 {
        font-size: 1.75rem;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .quick-access-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-form-panel {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
        border-radius: 20px;
        max-height: calc(100vh - 2rem);
    }
    
    .login-header {
        margin-bottom: 1rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .header-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .login-form {
        gap: 1rem;
    }
    
    .form-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .btn-login {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .login-footer-compact {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
}
