/* Estilos modernos para el login */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 50%, #fff8dc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #5a6c7d;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #87ceeb, #5a9fd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #718096;
    font-size: 1rem;
    font-weight: 400;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #87ceeb, #5a9fd4);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-link:hover::before {
    opacity: 1;
}

.social-link i {
    font-size: 1.2rem;
    color: #4a5568;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.social-link:hover i {
    color: white;
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: #87ceeb;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.15);
    background: white;
}

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

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
}

.project-selector-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
}

.project-selector-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(135, 206, 235, 0.15);
}

/* Selector de proyectos con paleta suave */
.project-selector {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
}

.project-selector-button {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e8f2ff;
    border-radius: 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    color: #5a6c7d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(135, 206, 235, 0.15);
}

.project-selector-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.08), rgba(255, 255, 224, 0.08));
    transition: left 0.4s ease;
}

.project-selector-button:hover::before {
    left: 0;
}

.project-selector-button:hover {
    border-color: #87ceeb;
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.25);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.98);
}

.project-selector-button:focus {
    outline: none;
    border-color: #87ceeb;
    box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.15);
    background: white;
}

.project-selector-button.open {
    border-color: #87ceeb;
    box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.15);
    background: white;
}

.selector-text {
    position: relative;
    z-index: 1;
    flex: 1;
    font-weight: 500;
    color: #5a6c7d;
}

.selector-icon {
    position: relative;
    z-index: 1;
    color: #87ceeb;
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

.project-selector-button.open .selector-icon {
    transform: rotate(180deg);
    color: #5a9fd4;
}

.project-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(135, 206, 235, 0.2);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.2);
    max-height: 390px; /* +30% (antes 300px) */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
    margin-top: 0.5rem;
}

.project-dropdown.show {
    display: block;
}

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

.project-dropdown::-webkit-scrollbar {
    width: 6px;
}

.project-dropdown::-webkit-scrollbar-track {
    background: rgba(135, 206, 235, 0.1);
    border-radius: 3px;
}

.project-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #87ceeb, #5a9fd4);
    border-radius: 3px;
}

.project-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a9fd4, #4682b4);
}

.project-option {
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(135, 206, 235, 0.1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-option:last-child {
    border-bottom: none;
}

.project-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.08), rgba(255, 255, 224, 0.08));
    transition: left 0.3s ease;
}

.project-option:hover::before {
    left: 0;
}

.project-option:hover {
    color: #5a9fd4;
    transform: translateX(3px);
}

.project-option.selected {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.12), rgba(255, 255, 224, 0.08));
    color: #5a9fd4;
    font-weight: 600;
}

.project-code {
    font-weight: 600;
    color: #87ceeb;
    margin-right: 0.5rem;
    position: relative;
    z-index: 1;
    background: rgba(135, 206, 235, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.project-name {
    position: relative;
    z-index: 1;
    color: #5a6c7d;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-option:hover .project-name {
    color: #5a9fd4;
}

.project-option:hover .project-code {
    background: rgba(135, 206, 235, 0.2);
    color: #5a9fd4;
}

.project-option.selected .project-name {
    color: #5a9fd4;
}

.project-option.selected .project-code {
    background: rgba(135, 206, 235, 0.25);
    color: #4682b4;
}

.project-option-empty {
    padding: 1rem 1.2rem;
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    cursor: default;
}

.project-option-loading {
    padding: 1rem 1.2rem;
    text-align: center;
    color: #87ceeb;
    font-style: italic;
    cursor: default;
}

.project-option-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e8f2ff;
    border-top: 2px solid #87ceeb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Overlay para cerrar el dropdown */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
}

.dropdown-overlay.show {
    display: block;
}

.login-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #87ceeb, #5a9fd4);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.3);
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.2);
}

.login-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.2);
}

.login-button.loading {
    position: relative;
    color: transparent;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #87ceeb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #5a9fd4;
    text-decoration: underline;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #e53e3e;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
    
    .login-title {
        font-size: 1.8rem;
    }
}
